from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_detection_lab_surfaces_yolo_runtime_preflight() -> None: 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"), ) ) hook = (ROOT / "frontend" / "src" / "hooks" / "useDetectionWorkflow.ts").read_text(encoding="utf-8") api = (ROOT / "frontend" / "src" / "services" / "api" / "detection.ts").read_text(encoding="utf-8") types = (ROOT / "frontend" / "src" / "types.ts").read_text(encoding="utf-8") app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8") assert "Technische YOLO-runtimecontrole" in lab assert "torch_version" in lab assert "ultralytics_version" in lab assert "cuda_available" in lab assert "onRefreshYoloPreflight" in lab assert "loadYoloPreflight" in hook assert "getYoloPreflight" in api assert "/api/v1/detection/yolo/preflight" in api assert "interface YoloPreflightResponse" in types assert "yoloPreflight={yoloPreflight}" in app def test_detection_lab_surfaces_local_model_asset_selection() -> None: 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"), ) ) hook = (ROOT / "frontend" / "src" / "hooks" / "useDetectionWorkflow.ts").read_text(encoding="utf-8") api = (ROOT / "frontend" / "src" / "services" / "api" / "detection.ts").read_text(encoding="utf-8") types = (ROOT / "frontend" / "src" / "types.ts").read_text(encoding="utf-8") app = (ROOT / "frontend" / "src" / "App.tsx").read_text(encoding="utf-8") provider_panel = (ROOT / "frontend" / "src" / "components" / "providers" / "ProviderPanel.tsx").read_text( encoding="utf-8" ) assert "interface ModelAssetRead" in types assert "model_asset_id?: string | null" in types assert "listModelAssets" in api assert "/api/v1/detection/model-assets" in api assert "modelAssets" in hook assert "selectedModelAssetId" in hook assert "model_asset_id: selectedModelAssetId || null" in hook assert "Lokaal modelbestand" in lab assert "onSelectModelAsset" in lab assert "modelAssets={modelAssets}" in app assert "Officiƫle referentiebronnen" in provider_panel assert "GRB is beschikbaar voor expliciet begrensde kaartselecties" in provider_panel assert "OSM blijft uitgeschakeld" in provider_panel