Files
geointel/tests/test_evaluate_belgium_building_candidate.py
T
Jens 7b222e6210
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
Add fail-closed regional detector routing
2026-07-30 02:27:17 +02:00

24 lines
873 B
Python

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"])