Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
n-dusan committed Nov 21, 2023
1 parent 3771289 commit 3ce3323
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use stelae::stelae::archive::Archive;

pub async fn initialize_app(
) -> impl Service<Request, Response = ServiceResponse<impl MessageBody>, Error = Error> {
initialize_archive("test_server");
initialize_git();
let archive = Archive::parse(get_test_archive_path(), &get_test_archive_path(), false).unwrap();
let state = AppState { archive };
Expand All @@ -43,3 +44,14 @@ pub fn get_test_archive_path() -> PathBuf {
path.push("tests/fixtures/archive");
path
}

pub fn initialize_archive(test_module_dir: &str) {
// TODO: try call once
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push(format!(
"{}/{}/{}/{}",
"tests", "fixtures", test_module_dir, "archive"
));
dbg!(&path);
create_dir_all(path).unwrap();
}

0 comments on commit 3ce3323

Please sign in to comment.