e047d884b6
Backend (uv): FastAPI app with routers (foods, log, targets, OFF proxy), SQLAlchemy models, Pydantic schemas, migration runner + 0001 initial schema, example pytest suite (7 tests). Frontend (npm): Vite 7 + Svelte 5 runes, lib/ (api, stores, scanner, format) per spec §7, placeholder components, example vitest suite (4 tests). SPEC.md §1: registered uvicorn and Vitest (rule §8.3.3).
25 lines
632 B
Python
25 lines
632 B
Python
"""Example API tests — scaffold for future suites (spec §8.4)."""
|
|
|
|
|
|
def test_health(client):
|
|
resp = client.get("/api/health")
|
|
assert resp.status_code == 200
|
|
assert resp.json() == {"status": "ok"}
|
|
|
|
|
|
def test_list_foods_empty(client):
|
|
resp = client.get("/api/foods")
|
|
assert resp.status_code == 200
|
|
assert resp.json() == []
|
|
|
|
|
|
def test_get_log_empty(client):
|
|
resp = client.get("/api/log", params={"date": "2026-07-25"})
|
|
assert resp.status_code == 200
|
|
assert resp.json() == []
|
|
|
|
|
|
def test_current_target_none(client):
|
|
resp = client.get("/api/targets/current")
|
|
assert resp.status_code == 404
|