Complete temporal detection safety gate
This commit is contained in:
@@ -105,6 +105,25 @@ def test_non_raster_dataset_request_is_rejected() -> None:
|
||||
assert getattr(exc_info.value, "code", None) == "INVALID_DATASET_TYPE"
|
||||
|
||||
|
||||
def test_historical_raster_marked_unsupported_is_rejected_before_run_creation() -> None:
|
||||
db, project_id, dataset_id = _project_and_dataset()
|
||||
source = db.get(Dataset, dataset_id)
|
||||
source.source_name = "digitaal_vlaanderen_orthophoto"
|
||||
source.source_metadata = {"product_key": "2020", "supports_detection": False}
|
||||
|
||||
with pytest.raises(Exception) as exc_info:
|
||||
DetectionService.run_detection(
|
||||
db=db,
|
||||
project_id=project_id,
|
||||
dataset_id=dataset_id,
|
||||
model_id="yolo-placeholder",
|
||||
confidence_threshold=0.5,
|
||||
)
|
||||
|
||||
assert getattr(exc_info.value, "code", None) == "DETECTION_SOURCE_TEMPORALLY_UNSUPPORTED"
|
||||
assert db.added == []
|
||||
|
||||
|
||||
def test_fixture_detector_persists_detections_only_with_explicit_fixture_mode() -> None:
|
||||
db, project_id, dataset_id = _project_and_dataset()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user