Enable governed GRB evolution
This commit is contained in:
@@ -119,6 +119,36 @@ def test_interior_buildings_skip_regional_owner_scan(monkeypatch) -> None:
|
||||
assert [item["id"] for item in features] == ["GBG.inside"]
|
||||
|
||||
|
||||
def test_building_partition_rejects_missing_official_source_identity() -> None:
|
||||
operator = load_operator()
|
||||
scopes = importlib.import_module("geographic_scopes")
|
||||
member = scopes.ScopeMember("Alpha", "10001")
|
||||
boundary = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
|
||||
scope = scopes.GeographicScope(
|
||||
key="single",
|
||||
display_name="Single",
|
||||
project_name="Single",
|
||||
project_region="Single",
|
||||
area_name="Single boundary",
|
||||
authority_name="Test",
|
||||
authority_url="https://example.test",
|
||||
scope_type="municipality",
|
||||
limitation_message="Test.",
|
||||
members=(member,),
|
||||
)
|
||||
missing_identity = feature("", Polygon([(0.1, 0.1), (0.2, 0.1), (0.2, 0.2), (0.1, 0.2)]))
|
||||
|
||||
with pytest.raises(RuntimeError, match="missing an official source identity"):
|
||||
operator.build_partition_features(
|
||||
[({"type": "FeatureCollection", "features": [missing_identity]}, "https://example.test/grb")],
|
||||
member=member,
|
||||
members=[(member, boundary)],
|
||||
regional_boundary=boundary,
|
||||
scope=scope,
|
||||
max_features=10,
|
||||
)
|
||||
|
||||
|
||||
def test_combined_artifact_streams_partitions_and_rejects_duplicate_source_ids(tmp_path: Path) -> None:
|
||||
operator = load_operator()
|
||||
scope = importlib.import_module("geographic_scopes").KEMPEN_TRANSPORT_REGION_SCOPE
|
||||
@@ -225,6 +255,8 @@ def test_regional_operator_is_packaged_documented_and_uses_service_boundaries()
|
||||
assert "provision_regional_grb_buildings.py" in dockerfile
|
||||
assert "py_compile scripts/provision_regional_grb_buildings.py" in readiness
|
||||
assert "DatasetService.import_partitioned_vector_artifact" in operator
|
||||
assert '"identity_stable": True' in operator
|
||||
assert '"identity_scheme": "grb_ogc_feature_id"' in operator
|
||||
assert "VectorFeatureService.persist_geojson_partitions" in dataset_service
|
||||
assert "insert into vector_features" not in operator.lower()
|
||||
assert "db.add(VectorFeature" not in operator
|
||||
|
||||
Reference in New Issue
Block a user