27 lines
759 B
Python
27 lines
759 B
Python
"""Smoke tests for health endpoints — do NOT require live Mongo."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
pytestmark = pytest.mark.anyio
|
|
|
|
|
|
async def test_root_endpoint_returns_metadata(asf_client):
|
|
resp = await asf_client.get("/")
|
|
assert resp.status_code == 200
|
|
body = resp.json()
|
|
assert body["name"] == "asf-core"
|
|
assert "docs" in body
|
|
assert body["health"] == "/api/v1/health"
|
|
|
|
|
|
async def test_health_liveness_ok(asf_client):
|
|
resp = await asf_client.get("/api/v1/health")
|
|
assert resp.status_code == 200
|
|
body = resp.json()
|
|
assert body["status"] == "ok"
|
|
assert body["service"] == "asf-core"
|
|
assert "uptime_seconds" in body
|
|
assert body["environment"] in {"development", "test", "production"}
|