Skip to content

Commit

Permalink
add test for get_ancestor_assaytype
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAkhmetov committed Dec 19, 2023
1 parent dc79923 commit af33d61
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
import zarr

from src.portal_visualization.builder_factory import get_view_config_builder, has_visualization
from src.portal_visualization.builder_factory import get_ancestor_assaytypes, get_view_config_builder, has_visualization


def str_presenter(dumper, data):
Expand All @@ -30,6 +30,10 @@ class MockResponse:
good_entity_paths = list((Path(__file__).parent / 'good-fixtures').glob("*/*-entity.json"))
assert len(good_entity_paths) > 0

image_pyramids = ["IMSViewConfBuilder", "SeqFISHViewConfBuilder", "NanoDESIViewConfBuilder"]
image_pyramid_paths = [path for path in good_entity_paths if path.parent.name in image_pyramids]
assert len(image_pyramid_paths) > 0

bad_entity_paths = list((Path(__file__).parent / 'bad-fixtures').glob("*-entity.json"))
assert len(bad_entity_paths) > 0

Expand Down Expand Up @@ -155,6 +159,14 @@ def clean_cells(cells):
]


@pytest.mark.parametrize(
"entity_path", image_pyramid_paths, ids=lambda path: f'{path.parent.name}/{path.name}')
def test_get_ancestor_assaytype(entity_path):
entity = json.loads(entity_path.read_text())
ancestor_assaytypes = get_ancestor_assaytypes(entity, get_assaytype)
assert len(ancestor_assaytypes) > 0


if __name__ == '__main__': # pragma: no cover
parser = argparse.ArgumentParser(description='Generate fixtures')
parser.add_argument(
Expand Down

0 comments on commit af33d61

Please sign in to comment.