Harden RC7 API response contracts
This commit is contained in:
@@ -514,7 +514,29 @@ def test_api_uses_canonical_envelopes(monkeypatch) -> None:
|
||||
monkeypatch.setattr(
|
||||
ThematicRasterAnalysisService,
|
||||
"analyze",
|
||||
lambda *_args, **_kwargs: {"dataset_id": str(dataset_id), "theme": "population", "summary": {"metric_value": 10.0}},
|
||||
lambda *_args, **_kwargs: {
|
||||
"dataset_id": str(dataset_id),
|
||||
"product_key": "population_density_2019",
|
||||
"theme": "population",
|
||||
"metric_kind": "population_density",
|
||||
"selection_bbox": payload().bbox.model_dump(),
|
||||
"selected_cell_count": 10,
|
||||
"valid_cell_count": 10,
|
||||
"coverage_ratio": 1.0,
|
||||
"resolution_m": 100.0,
|
||||
"observation_year": 2019,
|
||||
"summary": {
|
||||
"metric_label": "Geraamd aantal inwoners",
|
||||
"metric_value": 10.0,
|
||||
"metric_unit": "inwoners",
|
||||
"aggregation_method": "sum_density_cells",
|
||||
"primary_metric_key": "estimated_inhabitants",
|
||||
"metrics": [],
|
||||
},
|
||||
"unsupported_metrics": ["current_population"],
|
||||
"limitation_message": "2019 density estimate.",
|
||||
"generated_at": "2026-07-18T00:00:00Z",
|
||||
},
|
||||
)
|
||||
app.dependency_overrides[get_db] = lambda: db
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user