"""Liveness + basic gateway smoke tests.""" from fastapi.testclient import TestClient from svrnty_vision.server import app client = TestClient(app) def test_healthz_returns_200() -> None: resp = client.get("/healthz") assert resp.status_code == 200 body = resp.json() assert body["status"] == "ok" assert "version" in body def test_all_routes_registered() -> None: """Verify all 4 functional endpoints are mounted (not 404).""" routes = {r.path for r in app.routes} assert "/vlm/analyze" in routes assert "/flux/render" in routes assert "/palette/extract" in routes assert "/rembg/cutout" in routes def test_vlm_analyze_missing_body_returns_400() -> None: resp = client.post("/vlm/analyze", json={}) assert resp.status_code == 400 def test_palette_extract_missing_body_returns_400() -> None: resp = client.post("/palette/extract", json={}) assert resp.status_code == 400 def test_rembg_cutout_missing_body_returns_400() -> None: resp = client.post("/rembg/cutout", json={}) assert resp.status_code == 400