All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 41s
Add the PostgreSQL backend, migration and stopped-write transfer tools, lease-aware deployment manifests, tenancy declarations, and shared conformance coverage. Persist grouping mutations in durable stores and separate process liveness from database readiness.
26 lines
773 B
Python
26 lines
773 B
Python
from fastapi.testclient import TestClient
|
|
|
|
from tenant_engine.app import create_app
|
|
|
|
|
|
def test_health_endpoint() -> None:
|
|
client = TestClient(create_app())
|
|
response = client.get("/health")
|
|
|
|
assert response.status_code == 200
|
|
body = response.json()
|
|
assert body["status"] == "ok"
|
|
assert body["service"] == "tenant-engine"
|
|
assert body["store_backend"] == "memory"
|
|
|
|
|
|
def test_liveness_endpoint_does_not_depend_on_the_store() -> None:
|
|
class _UnavailableStore:
|
|
def ping(self) -> None:
|
|
raise AssertionError("liveness must not touch the store")
|
|
|
|
client = TestClient(create_app(store=_UnavailableStore()))
|
|
response = client.get("/live")
|
|
|
|
assert response.status_code == 200
|
|
assert response.json()["status"] == "ok"
|