initial commit
This commit is contained in:
commit
88c14b627e
224 files changed
+17204
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from lincodex_ml.main import app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def anyio_backend() -> str:
|
||||
return "asyncio"
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_health_reports_process_liveness() -> None:
|
||||
async with httpx.AsyncClient(
|
||||
transport=httpx.ASGITransport(app=app), base_url="http://test"
|
||||
) as client:
|
||||
response = await client.get("/healthz")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"status": "ok"}
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_readiness_reports_missing_inference_runtime() -> None:
|
||||
async with httpx.AsyncClient(
|
||||
transport=httpx.ASGITransport(app=app), base_url="http://test"
|
||||
) as client:
|
||||
response = await client.get("/readyz")
|
||||
|
||||
assert response.status_code == 503
|
||||
assert response.json() == {"status": "not_ready"}
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_metrics_endpoint_exposes_prometheus_registry() -> None:
|
||||
async with httpx.AsyncClient(
|
||||
transport=httpx.ASGITransport(app=app),
|
||||
base_url="http://test",
|
||||
follow_redirects=True,
|
||||
) as client:
|
||||
response = await client.get("/metrics")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "python_info" in response.text
|
||||
Reference in new issue
Block a user