Files
fund-tracer/backend/tests/test_api.py

20 lines
467 B
Python
Raw Normal View History

2026-03-11 16:28:04 +08:00
"""API integration tests."""
import pytest
from httpx import AsyncClient, ASGITransport
from app.main import app
@pytest.fixture
async def client():
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url="http://test") as c:
yield c
@pytest.mark.asyncio
async def test_health(client: AsyncClient):
resp = await client.get("/health")
assert resp.status_code == 200
assert resp.json()["status"] == "ok"