You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
618 B
Python

"""
应用入口测试 —— 健康检查接口返回码与响应体校验。
"""
from fastapi.testclient import TestClient
def test_check_readiness(test_client: TestClient) -> None:
response = test_client.get("/common/health/ready/")
assert response.status_code == 200
body = response.json()
assert body["success"] is True
assert body["data"] is not None
def test_check_health(test_client: TestClient) -> None:
response = test_client.get("/common/health/")
assert response.status_code == 200
body = response.json()
assert body["success"] is True
assert body["code"] == 0