Files
Aurora-Core/tests/integration/test_health.py
T

27 lines
783 B
Python
Raw Normal View History

2026-09-04 17:34:03 -05:00
"""Integration tests for liveness/readiness (section 24). Requires
PostgreSQL and Redis — see tests/conftest.py."""
from __future__ import annotations
import pytest
from httpx import AsyncClient
pytestmark = pytest.mark.usefixtures("db_session")
@pytest.mark.asyncio
async def test_health_is_always_ok(client: AsyncClient):
response = await client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
@pytest.mark.asyncio
async def test_ready_reports_postgresql_dependency(client: AsyncClient):
response = await client.get("/ready")
assert response.status_code == 200
body = response.json()
names = {dep["name"] for dep in body["dependencies"]}
assert "postgresql" in names
assert "redis" in names