Add fail-closed regional detector routing
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:
Jens
2026-07-30 02:27:17 +02:00
parent e987f9224c
commit 7b222e6210
2 changed files with 70 additions and 3 deletions
@@ -0,0 +1,23 @@
from pathlib import Path
import pytest
from scripts.evaluate_belgium_building_candidate import parse_regional_models
def test_parse_regional_models_accepts_explicit_unique_routes() -> None:
assert parse_regional_models(["flanders=/models/flanders.pt", "wallonia=/models/wallonia.pt"]) == {
"flanders": Path("/models/flanders.pt"),
"wallonia": Path("/models/wallonia.pt"),
}
@pytest.mark.parametrize("value", ["flanders", "=/model.pt", "flanders="])
def test_parse_regional_models_rejects_incomplete_routes(value: str) -> None:
with pytest.raises(ValueError, match="expected REGION"):
parse_regional_models([value])
def test_parse_regional_models_rejects_duplicate_routes() -> None:
with pytest.raises(ValueError, match="Duplicate regional model"):
parse_regional_models(["flanders=/first.pt", "FLANDERS=/second.pt"])