From 8cf74ecb31ef9150107e9cd8b8f088ef7b37ecf5 Mon Sep 17 00:00:00 2001 From: Yi-Che Oliver Chang Date: Sun, 24 Sep 2023 12:29:52 -0400 Subject: [PATCH] update tests to reflect change in type of metadata returned by reader --- .../readers/extra_readers/test_nd2_reader.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/aicsimageio/tests/readers/extra_readers/test_nd2_reader.py b/aicsimageio/tests/readers/extra_readers/test_nd2_reader.py index 1b12d49bb..304c1f356 100644 --- a/aicsimageio/tests/readers/extra_readers/test_nd2_reader.py +++ b/aicsimageio/tests/readers/extra_readers/test_nd2_reader.py @@ -31,7 +31,8 @@ "expected_dtype, " "expected_dims_order, " "expected_channel_names, " - "expected_physical_pixel_sizes", + "expected_physical_pixel_sizes, " + "expected_metadata_type", [ pytest.param( "example.txt", @@ -42,6 +43,7 @@ None, None, None, + None, marks=pytest.mark.xfail(raises=exceptions.UnsupportedFileFormatError), ), pytest.param( @@ -53,6 +55,7 @@ "TCYX", ["20phase", "20xDiO"], (1, 50, 50), + dict, ), ( "ND2_jonas_header_test2.nd2", @@ -63,6 +66,7 @@ "CTZYX", ["Jonas_DIC"], (0.5, 0.12863494437945, 0.12863494437945), + OME, ), ( "ND2_maxime_BF007.nd2", @@ -73,6 +77,7 @@ "CYX", ["405/488/561/633nm"], (1.0, 0.158389678930686, 0.158389678930686), + OME, ), ( "ND2_dims_p4z5t3c2y32x32.nd2", @@ -83,6 +88,7 @@ "TZCYX", ["Widefield Green", "Widefield Red"], (1.0, 0.652452890023035, 0.652452890023035), + OME, ), ( "ND2_dims_c2y32x32.nd2", @@ -93,6 +99,7 @@ "CYX", ["Widefield Green", "Widefield Red"], (1.0, 0.652452890023035, 0.652452890023035), + OME, ), ( "ND2_dims_p1z5t3c2y32x32.nd2", @@ -103,6 +110,7 @@ "TZCYX", ["Widefield Green", "Widefield Red"], (1.0, 0.652452890023035, 0.652452890023035), + OME, ), ( "ND2_dims_p2z5t3-2c4y32x32.nd2", @@ -113,6 +121,7 @@ "TZCYX", ["Widefield Green", "Widefield Red", "Widefield Far-Red", "Brightfield"], (1.0, 0.652452890023035, 0.652452890023035), + OME, ), ( "ND2_dims_t3c2y32x32.nd2", @@ -123,6 +132,7 @@ "TCYX", ["Widefield Green", "Widefield Red"], (1.0, 0.652452890023035, 0.652452890023035), + OME, ), ( "ND2_dims_rgb_t3p2c2z3x64y64.nd2", @@ -133,6 +143,7 @@ "TZCYXS", ["Brightfield", "Brightfield"], (0.01, 0.34285714285714286, 0.34285714285714286), + OME, ), ( "ND2_dims_rgb.nd2", @@ -143,6 +154,7 @@ "CYXS", ["Brightfield"], (1.0, 0.34285714285714286, 0.34285714285714286), + OME, ), ], ) @@ -156,6 +168,7 @@ def test_nd2_reader( expected_dims_order: str, expected_channel_names: List[str], expected_physical_pixel_sizes: Tuple[float, float, float], + expected_metadata_type: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]], ) -> None: # Construct full filepath uri = get_resource_full_path(filename, host) @@ -172,7 +185,7 @@ def test_nd2_reader( expected_dims_order=expected_dims_order, expected_channel_names=expected_channel_names, expected_physical_pixel_sizes=expected_physical_pixel_sizes, - expected_metadata_type=dict, + expected_metadata_type=expected_metadata_type, ) @@ -196,7 +209,7 @@ def test_nd2_reader( dimensions.DEFAULT_DIMENSION_ORDER, ["Jonas_DIC"], (0.5, 0.12863494437945, 0.12863494437945), - dict, + OME, ), ], )