-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f749742
commit 6712b3d
Showing
4 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import shutil | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
TEMP_DIR = Path("./temp_directory") | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def naive_bdv_directory(): | ||
test_dir = Path("./test_directory") | ||
|
||
shutil.copytree( | ||
TEMP_DIR, | ||
test_dir, | ||
dirs_exist_ok=True, | ||
ignore=shutil.ignore_patterns("*data_bdv.h5"), | ||
) | ||
# Create UNIX style hidden files that should be ignored | ||
(test_dir / ".test_data_original_bdv.h5").touch() | ||
(test_dir / ".test_data_bdv.h5_meta.txt").touch() | ||
(test_dir / ".test_data_bdv.h5_meta.txt").touch() | ||
|
||
yield test_dir | ||
|
||
shutil.rmtree(test_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
from brainglobe_stitch.image_mosaic import ImageMosaic | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def image_mosaic(naive_bdv_directory): | ||
os.remove(naive_bdv_directory / "test_data_bdv_tile_config.txt") | ||
image_mosaic = ImageMosaic(naive_bdv_directory) | ||
|
||
return image_mosaic | ||
|
||
|
||
def test_image_mosaic_init(image_mosaic, naive_bdv_directory): | ||
image_mosaic = image_mosaic | ||
assert image_mosaic.xml_path == naive_bdv_directory / "test_data_bdv.xml" | ||
assert ( | ||
image_mosaic.meta_path | ||
== naive_bdv_directory / "test_data_bdv.h5_meta.txt" | ||
) | ||
assert ( | ||
image_mosaic.h5_path | ||
== naive_bdv_directory / "test_data_original_bdv.h5" | ||
) |