17 lines
452 B
Python
17 lines
452 B
Python
|
|
"""Tests for the health endpoint."""
|
||
|
|
|
||
|
|
import pytest
|
||
|
|
from httpx import AsyncClient
|
||
|
|
|
||
|
|
|
||
|
|
@pytest.mark.asyncio
|
||
|
|
async def test_health_returns_ok(client: AsyncClient):
|
||
|
|
"""GET /api/health should return 200 with status ok."""
|
||
|
|
response = await client.get("/api/health")
|
||
|
|
assert response.status_code == 200
|
||
|
|
data = response.json()
|
||
|
|
assert "status" in data
|
||
|
|
assert "db" in data
|
||
|
|
assert "redis" in data
|
||
|
|
assert data["redis"] == "connected"
|