GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
24 lines
873 B
Python
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"])
|