"""Tests der Systemendpunkte und des Fehlerformats.""" from httpx import AsyncClient async def test_health_meldet_datenbank_ok(client: AsyncClient) -> None: response = await client.get("/api/health") assert response.status_code == 200 body = response.json() assert body["status"] == "ok" assert body["database"] == "ok" # Zeitstempel muss in Europe/Berlin geliefert werden (+01:00 oder +02:00). assert body["time"].endswith(("+01:00", "+02:00")) async def test_version_liefert_stammdaten(client: AsyncClient) -> None: body = (await client.get("/api/version")).json() assert body["name"] == "moneyfy" assert body["timezone"] == "Europe/Berlin" assert body["currency"] == "EUR" async def test_unbekannte_route_liefert_fehlerformat(client: AsyncClient) -> None: response = await client.get("/api/gibt-es-nicht") assert response.status_code == 404 assert response.json() == {"detail": "Not Found", "code": "not_found"}