Kairo-Jinkendo/backend/tests/test_health.py
Lars 564008be13
Some checks failed
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Failing after 7s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
AP0.2: Auth, Tenant, Actor Foundation mit Sessions, TenantContext und Tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 20:09:54 +02:00

32 lines
697 B
Python

import os
import pytest
from fastapi.testclient import TestClient
@pytest.fixture()
def client(monkeypatch):
monkeypatch.setenv("SKIP_DB_MIGRATE", "1")
monkeypatch.setenv("SKIP_BOOTSTRAP", "1")
import importlib
import main as main_module
importlib.reload(main_module)
return TestClient(main_module.app)
def test_app_importable():
import main
assert main.app is not None
def test_health_endpoint(client):
response = client.get("/api/health")
assert response.status_code == 200
payload = response.json()
assert payload["app"] == "jinkendo-kairo"
assert payload["status"] in {"ok", "degraded"}
assert payload["db"] in {"ok", "error"}