Harden RC7 API response contracts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user