FastAPI + SQLAlchemy async + Alembic scaffold, src-layout (mirrors the
sowai-fiscal lib's own convention), pyproject wired to sowai-fiscal@v0.1.0
via git+https (uv.lock pins the commit). Makefile mirrors auto/Makefile's
k8s-test workflow: syncs into /app/fiscal-svc in the SAME auto-tests pod,
against a dedicated fiscal_svc_test database on the shared Postgres
sidecar, serialized by the SAME lock file the auto uses on purpose so the
two repos' test runs never race in the pod. Dockerfile installs git (the
git+https dependency needs it at uv sync time) and splits the dependency
layer from the project's own editable install for build caching.
GET /v1/health -> {"status": "ok"}, verified green via `make k8s-test`.
14 lines
415 B
Python
14 lines
415 B
Python
from httpx import ASGITransport, AsyncClient
|
|
import pytest
|
|
|
|
from fiscal_svc.main import app
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_health_check_returns_ok():
|
|
transport = ASGITransport(app=app)
|
|
async with AsyncClient(transport=transport, base_url="http://test") as client:
|
|
response = await client.get("/v1/health")
|
|
assert response.status_code == 200
|
|
assert response.json() == {"status": "ok"}
|