From 78461d0fa94976e48dd459d7e6fec8f696b4a691 Mon Sep 17 00:00:00 2001 From: Tommaso Comparin <3862206+tcompa@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:57:15 +0100 Subject: [PATCH] Update tests (ref #593) --- tests/tasks/test_workflows_napari_workflows.py | 16 ++++++++++++++-- tests/test_unit_input_models.py | 8 ++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/tasks/test_workflows_napari_workflows.py b/tests/tasks/test_workflows_napari_workflows.py index 43b6d2dea..b9bb90eb5 100644 --- a/tests/tasks/test_workflows_napari_workflows.py +++ b/tests/tasks/test_workflows_napari_workflows.py @@ -92,6 +92,7 @@ def test_napari_workflow( output_specs = { "regionprops_DAPI": { # type: ignore # noqa "type": "dataframe", + "label_name": "label_DAPI", "table_name": "regionprops_DAPI", }, } @@ -233,7 +234,11 @@ def test_napari_worfklow_label_input_only( input_label={"type": "label", "label_name": LABEL_NAME}, ) output_specs = dict( - output_dataframe={"type": "dataframe", "table_name": TABLE_NAME} + output_dataframe={ + "type": "dataframe", + "table_name": TABLE_NAME, + "label_name": LABEL_NAME, + } ) RELABELING_CASE_2: list = [workflow_file_name, input_specs, output_specs] # 3. Mixed labeling/measurement workflow. @@ -243,7 +248,11 @@ def test_napari_worfklow_label_input_only( ) output_specs = dict( output_label={"type": "label", "label_name": LABEL_NAME}, - output_dataframe={"type": "dataframe", "table_name": TABLE_NAME}, + output_dataframe={ + "type": "dataframe", + "table_name": TABLE_NAME, + "label_name": LABEL_NAME, + }, ) RELABELING_CASE_3: list = [workflow_file_name, input_specs, output_specs] # Assemble three cases @@ -516,6 +525,7 @@ def test_napari_workflow_empty_input_ROI_table( "regionprops_DAPI": { # type: ignore # noqa "type": "dataframe", "table_name": "regionprops_DAPI", + "label_name": "label_DAPI", }, } for component in metadata["image"]: @@ -609,6 +619,7 @@ def test_napari_workflow_CYX( "regionprops_DAPI": { # type: ignore # noqa "type": "dataframe", "table_name": "regionprops_DAPI", + "label_name": "label_DAPI", }, } for component in metadata["image"]: @@ -789,6 +800,7 @@ def test_napari_workflow_mock( "regionprops_DAPI": { # type: ignore # noqa "type": "dataframe", "table_name": "regionprops_DAPI", + "label_name": "label_DAPI", }, } diff --git a/tests/test_unit_input_models.py b/tests/test_unit_input_models.py index d9abb7ae4..b9d11d997 100644 --- a/tests/test_unit_input_models.py +++ b/tests/test_unit_input_models.py @@ -98,6 +98,13 @@ def test_NapariWorkflowsOutput(): ) debug(e.value) + with pytest.raises(ValueError) as e: + NapariWorkflowsOutput( + type="dataframe", + table_name="something", + ) + debug(e.value) + # Valid specs = NapariWorkflowsOutput( @@ -110,6 +117,7 @@ def test_NapariWorkflowsOutput(): specs = NapariWorkflowsOutput( type="dataframe", + label_name="label_DAPI", table_name="table_DAPI", ) debug(specs)