feat: mount peripheral API in main server
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user