forked from mtusi2026/mtusi2026lab4
Реализация лабораторной работы 4 на 4
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import httpx
|
||||
from helpers import assert_error
|
||||
|
||||
|
||||
def test_health_endpoints_have_request_id(api: httpx.Client) -> None:
|
||||
for path in ("/health/live", "/health/ready"):
|
||||
response = api.get(path)
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"status": "ok"}
|
||||
assert response.headers["X-Request-Id"]
|
||||
|
||||
|
||||
def test_unknown_route_uses_error_format(api: httpx.Client) -> None:
|
||||
assert_error(api.get("/api/v1/unknown"), 404, "not_found")
|
||||
|
||||
Reference in New Issue
Block a user