Files
geointel/backend/tests/test_sprint212_platform_source_portfolio.py
T
NuklearRabbit edb762219c
Managed validation / full (pull_request) Canceled after 0s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (pull_request) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Failing after 22s
GeoIntel release gates / Compile, test, contracts and builds (push) Waiting to run
GeoIntel release gates / GIS image, SBOM and container scan (push) Failing after 45s
fix(ci): restore release gates and contract baseline (fixes #4)
2026-08-29 02:00:23 +02:00

75 lines
2.9 KiB
Python

from pathlib import Path
from tests.frontend_contract import read_feature
ROOT = Path(__file__).resolve().parents[2]
def test_source_portfolio_covers_the_complete_platform() -> None:
portfolio = (ROOT / "frontend/src/lib/sourcePortfolio.ts").read_text(encoding="utf-8")
for domain in ("space", "nature", "soil", "mobility", "people", "climate"):
assert f"key: '{domain}'" in portfolio
for source in (
"Landgebruik Vlaanderen",
"Digitale bodemkaart",
"Bedrijventerreinen OSLO",
"Knooppuntwaarde per hectare",
"Statistische sectoren",
"Inwonersdichtheid per hectare",
"Totaal voorzieningenniveau",
"Hitte-eilanden in steden",
"Luchtkwaliteit",
"Vlaamse Hydrografische Atlas",
):
assert source in portfolio
assert portfolio.count("domain: 'climate'") < portfolio.count("domain:") / 2
assert "OFFICIAL_SOURCE_PORTFOLIO" in portfolio
assert "dataset.status === 'ready'" in portfolio
def test_source_inventory_is_compact_honest_and_domain_driven() -> None:
catalog = read_feature("datasets")
styles = (ROOT / "frontend/src/styles/app.css").read_text(encoding="utf-8")
assert "Welke vragen kan GeoIntel beantwoorden?" in catalog
assert "Zes domeinen vormen samen het platform" in catalog
assert "operationalSources(ready)" in catalog
assert "Dekking per kaartthema en tijdreeks" in catalog
assert "Actieve broncollecties en hun beperkingen" in catalog
assert "Officiële bronnen die hierna kunnen worden ingeladen" in catalog
assert "Meetbaar als:" in catalog
assert "source-domain-grid" in styles
assert "source-opportunity-domain" in styles
assert "section.source-catalog-panel > .panel-title-row" in styles
assert "display: grid" in styles
assert "justify-self: start" in styles
def test_roadmap_prioritizes_cross_domain_profile_before_more_water_layers() -> None:
roadmap = (ROOT / "docs/DATAVINDPLAATS_SOURCE_ROADMAP.md").read_text(encoding="utf-8")
assert "Water is one analysis domain" in roadmap
assert "Wave 1 - Cross-domain area profile" in roadmap
assert "space occupation 2025" in roadmap
assert "population density 2019" in roadmap
assert "node value 2022" in roadmap
assert "total service level 2022" in roadmap
assert "digital soil map" in roadmap
assert "VHA/runoff as hydrological context" in roadmap
assert "Governed Flemish Thematic Raster Registry - Wave 1" in roadmap
def test_portfolio_pass_does_not_add_provider_fetch_or_persistence_code() -> None:
changed_scope = {
"frontend/src/lib/sourcePortfolio.ts",
"frontend/src/components/datasets/SourceCatalogPanel.tsx",
"frontend/src/styles/app.css",
"docs/DATAVINDPLAATS_SOURCE_ROADMAP.md",
}
assert not any(path.startswith("backend/app/") for path in changed_scope)
assert not any("migration" in path for path in changed_scope)