24 lines
677 B
Python
24 lines
677 B
Python
from fastapi.testclient import TestClient
|
|
|
|
from app.main import app
|
|
|
|
|
|
def test_main_server_mounts_peripheral_health_endpoint():
|
|
response = TestClient(app).get("/peripheral/health")
|
|
|
|
assert response.status_code == 200
|
|
assert response.json() == {
|
|
"service": "peripheral-sample",
|
|
"origin": "synthetic",
|
|
"storage": "postgresql",
|
|
"status": "up",
|
|
"storage_verified": False,
|
|
}
|
|
|
|
|
|
def test_mounted_peripheral_api_preserves_its_authentication_boundary():
|
|
response = TestClient(app).get("/peripheral/api/sample/v1/context")
|
|
|
|
assert response.status_code == 401
|
|
assert response.json()["code"] == "AUTHENTICATION_REQUIRED"
|