Files
next-tjwater-server/tests/api/test_peripheral_mount.py
jiang 6d31f456e6
Generic Container CI/CD / test-build-publish (push) Successful in 2m59s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 2m59s
feat: mount peripheral API in main server
2026-10-23 16:05:56 +08:00

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"