Harden RC7 API response contracts
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-18 05:07:35 +02:00
parent 8e49b857dd
commit 0fae53a7de
36 changed files with 886 additions and 153 deletions
@@ -385,9 +385,27 @@ def test_flood_hazard_api_uses_canonical_envelopes(monkeypatch) -> None:
"analyze",
lambda *_args, **_kwargs: {
"dataset_id": str(output_dataset_id),
"product_key": "pluviaal_current_t100",
"mechanism": "pluviaal",
"climate_context": "huidig klimaat",
"probability_class": "middelgrote kans",
"return_period_years": 100,
"selection_bbox": flood_payload().bbox.model_dump(),
"selected_cell_count": 10,
"inundated_cell_count": 4,
"summary": {"metric_value": 0.01, "metric_unit": "ha", "metrics": []},
"inundated_fraction": 0.4,
"resolution_m": 5.0,
"summary": {
"metric_label": "Overstroomde oppervlakte",
"metric_value": 0.01,
"metric_unit": "ha",
"aggregation_method": "positive_depth_area",
"primary_metric_key": "inundated_area_ha",
"metrics": [],
},
"unsupported_metrics": ["permanent_water_volume_m3"],
"limitation_message": "Scenario depth is not bathymetry.",
"generated_at": "2026-07-18T00:00:00Z",
},
)
monkeypatch.setattr(
@@ -397,7 +415,27 @@ def test_flood_hazard_api_uses_canonical_envelopes(monkeypatch) -> None:
"dataset_id": str(output_dataset_id),
"dataset_ids": [str(output_dataset_id)],
"partition_count": 1,
"product_key": "pluviaal_current_t100",
"mechanism": "pluviaal",
"climate_context": "huidig klimaat",
"probability_class": "middelgrote kans",
"return_period_years": 100,
"selection_bbox": flood_payload().bbox.model_dump(),
"selected_cell_count": 10,
"inundated_cell_count": 4,
"inundated_fraction": 0.4,
"resolution_m": 5.0,
"summary": {
"metric_label": "Overstroomde oppervlakte",
"metric_value": 0.01,
"metric_unit": "ha",
"aggregation_method": "positive_depth_area",
"primary_metric_key": "inundated_area_ha",
"metrics": [],
},
"unsupported_metrics": ["permanent_water_volume_m3"],
"limitation_message": "Scenario depth is not bathymetry.",
"generated_at": "2026-07-18T00:00:00Z",
},
)
app.dependency_overrides[get_db] = lambda: db