- palette.py + rembg.py: implement from stubs (Pillow median-cut + rembg u2net) - vlm.py: rename Spark2→steev (Strix Halo / Ollama); bump max_tokens 1024→4096 (qwen3-vl:32b thinking mode consumes budget tokens — 4096 min for valid output) - settings.py: rename spark2_vlm_*/spark1_flux_* → vlm_*/flux_*; real defaults (steev 100.88.167.87:11434 Ollama, gx10 100.90.100.10:8188 ComfyUI) - tests/: conftest.py + test_palette.py + test_rembg.py + test_integration_e2e.py (28 unit + 10 integration; 38/38 passing — VLM raw/polished/ugc + FLUX render) - CLAUDE.md: rewrite to accurate phase status + infra + layout - requirements.txt + pyproject.toml: add Pillow, rembg, pytest-asyncio deps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""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
|