diff --git a/tests/tasks/test_workflows_cellpose_segmentation.py b/tests/tasks/test_workflows_cellpose_segmentation.py index a5ac0043f..5bb0fad2e 100644 --- a/tests/tasks/test_workflows_cellpose_segmentation.py +++ b/tests/tasks/test_workflows_cellpose_segmentation.py @@ -34,6 +34,7 @@ from ._validation import validate_schema from .lib_empty_ROI_table import _add_empty_ROI_table from fractal_tasks_core.lib_input_models import Channel +from fractal_tasks_core.lib_zarr import OverwriteNotAllowedError from fractal_tasks_core.tasks.cellpose_segmentation import ( cellpose_segmentation, ) @@ -510,6 +511,37 @@ def test_workflow_bounding_box( output_ROI_table="bbox_table", ) + # Re-run with overwrite=True + for component in metadata["image"]: + cellpose_segmentation( + input_paths=[str(zarr_path)], + output_path=str(zarr_path), + metadata=metadata, + component=component, + channel=Channel(wavelength_id="A01_C01"), + level=3, + relabeling=True, + diameter_level0=80.0, + output_ROI_table="bbox_table", + overwrite=True, + ) + + # Re-run with overwrite=False + with pytest.raises(OverwriteNotAllowedError): + for component in metadata["image"]: + cellpose_segmentation( + input_paths=[str(zarr_path)], + output_path=str(zarr_path), + metadata=metadata, + component=component, + channel=Channel(wavelength_id="A01_C01"), + level=3, + relabeling=True, + diameter_level0=80.0, + output_ROI_table="bbox_table", + overwrite=False, + ) + bbox_ROIs = ad.read_zarr( str(zarr_path / metadata["image"][0] / "tables/bbox_table/") )