Files
geointel/backend/tests/test_sprint123_raster_detection_handoff_operational.py
T
Codex 78a5f0b0b2
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s
Close full operational audit findings
2026-07-17 14:19:02 +02:00

50 lines
2.2 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
def test_raster_workflow_exposes_structured_tile_manifest_handoff() -> None:
hook = (ROOT / "frontend" / "src" / "hooks" / "useDatasetWorkflow.ts").read_text(encoding="utf-8")
types = (ROOT / "frontend" / "src" / "types.ts").read_text(encoding="utf-8")
assert "interface RasterTileHandoff" in types
assert "latestRasterTileManifest" in hook
assert "toRasterTileHandoff(job)" in hook
assert "setLatestRasterTileManifest(manifest)" in hook
assert "manifest.manifest_path" in hook
def test_raster_controls_show_manifest_details_and_ai_handoff_action() -> None:
controls = (ROOT / "frontend" / "src" / "components" / "datasets" / "RasterControls.tsx").read_text(
encoding="utf-8"
)
assert "latestRasterTileManifest" in controls
assert "Aantal tegels" in controls
assert "Tegelgrootte" in controls
assert "Overlap" in controls
assert "Gebruik voor gebouwdetectie" in controls
assert "Gebruik voor segmentatie" in controls
def test_detection_handoff_opens_ai_lab_preflights_manifest_and_keeps_asset_explicit() -> None:
app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8")
lab = "\n".join(
(
(ROOT / "frontend" / "src" / "components" / "detection" / "DetectionLab.tsx").read_text(encoding="utf-8"),
(ROOT / "frontend" / "src" / "components" / "detection" / "DetectionModelManagement.tsx").read_text(encoding="utf-8"),
)
)
assert "setDetectionTileManifestPath(manifestPath)" in app
assert "setSelectedDetectionDatasetId(selectedDataset.id)" in app
assert "setSelectedDetectionModelId('yolo-configured')" in app
assert "setDetectionConfidenceThreshold(0.25)" in app
assert "loadYoloPreflight(manifestPath).catch(() => null)" in app
assert "setSelectedModelAssetId(" not in app[app.index("const useRasterTileManifestForDetection"):app.index("const {", app.index("const useRasterTileManifestForDetection"))]
assert "Gekoppelde beeldtegels" in lab
assert "Gekoppelde beeldtegels" in lab
assert "Aantal beeldtegels" in lab
assert "yoloPreflight.tile_count" in lab