Federate official Belgium data sources
This commit is contained in:
@@ -205,6 +205,42 @@ def test_preflight_reconciles_spatial_and_unlocated_population(tmp_path: Path) -
|
||||
assert len(manifest["schemas"]["geometry_schema_sha256"]) == 64
|
||||
|
||||
|
||||
def test_preflight_supports_the_complete_national_scope() -> None:
|
||||
result = PREFLIGHT.validate_statbel_release(
|
||||
year=2025,
|
||||
layout="new",
|
||||
population_content=population_archive(),
|
||||
population_url=POPULATION_URL,
|
||||
geometry_content=geometry_archive(),
|
||||
geometry_url=GEOMETRY_URL,
|
||||
scope=PREFLIGHT.GEOGRAPHIC_SCOPES["belgium"],
|
||||
)
|
||||
|
||||
accounting = result.manifest["scope_accounting"]
|
||||
assert accounting["scope_key"] == "belgium"
|
||||
assert accounting["member_count"] == 2
|
||||
assert accounting["member_nis_codes"] == ["13008", "13025"]
|
||||
assert accounting["spatial_population_total"] == 240
|
||||
assert accounting["unlocated_population_total"] == 3
|
||||
assert accounting["accounted_population_total"] == 243
|
||||
|
||||
|
||||
def test_national_preflight_rejects_an_unscoped_baseline(tmp_path: Path) -> None:
|
||||
with pytest.raises(PREFLIGHT.StatbelPreflightError) as exc_info:
|
||||
PREFLIGHT.validate_statbel_release(
|
||||
year=2025,
|
||||
layout="new",
|
||||
population_content=population_archive(),
|
||||
population_url=POPULATION_URL,
|
||||
geometry_content=geometry_archive(),
|
||||
geometry_url=GEOMETRY_URL,
|
||||
scope=PREFLIGHT.GEOGRAPHIC_SCOPES["belgium"],
|
||||
baseline_snapshot=baseline_snapshot(tmp_path / "baseline.geojson"),
|
||||
)
|
||||
|
||||
assert exc_info.value.code == "STATBEL_BASELINE_SCOPE_MISMATCH"
|
||||
|
||||
|
||||
def test_preflight_reports_bounded_topology_repairs(tmp_path: Path) -> None:
|
||||
result = validate(tmp_path, geometry_content=geometry_archive(repairable_invalid=True))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user