Server: basic implementation. Not tested => no python installed; bugfix in ESP (uvicorn on port 8090)

This commit is contained in:
Thomas Karner committed 2026-09-20 23:49:40 +02:00
1 parent 3694cdf207
commit 8a51e3d95e
38 files changed
+2442 -21

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
from __future__ import annotations
from conftest import needs_db
def test_health_answers_even_without_a_database(client):
"""The WebUI banner must be able to render a degraded system."""
r = client.get("/api/v1/health")
assert r.status_code == 200
body = r.json()
assert body["status"] in {"ok", "degraded"}
assert "database" in body
assert "disk" in body
assert body["version"]
@needs_db
def test_health_is_ok_with_a_database(client):
body = client.get("/api/v1/health").json()
assert body["status"] == "ok"
assert body["database"]["ok"] is True
@needs_db
def test_healthz_is_200_when_the_database_is_up(client):
assert client.get("/healthz").status_code == 200
def test_openapi_is_served(client):
assert client.get("/openapi.json").status_code == 200