Complete temporal detection safety gate
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-18 00:53:00 +02:00
parent fc42ea9af5
commit 9146981802
16 changed files with 689 additions and 23 deletions
@@ -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()