Skip to content

Commit

Permalink
Update tests (ref #593)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompa committed Nov 27, 2023
1 parent 7043d64 commit 78461d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/tasks/test_workflows_napari_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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"]:
Expand Down Expand Up @@ -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"]:
Expand Down Expand Up @@ -789,6 +800,7 @@ def test_napari_workflow_mock(
"regionprops_DAPI": { # type: ignore # noqa
"type": "dataframe",
"table_name": "regionprops_DAPI",
"label_name": "label_DAPI",
},
}

Expand Down
8 changes: 8 additions & 0 deletions tests/test_unit_input_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -110,6 +117,7 @@ def test_NapariWorkflowsOutput():

specs = NapariWorkflowsOutput(
type="dataframe",
label_name="label_DAPI",
table_name="table_DAPI",
)
debug(specs)
Expand Down

0 comments on commit 78461d0

Please sign in to comment.