mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 20:55:14 +00:00
- 重构API路由与请求路径,统一批量状态更新接口 - 优化类型导入与参数继承逻辑,简化基础查询参数实现 - 修复日志格式化与权限校验细节问题 - 新增多模块接口测试用例,完善测试覆盖 - 调整环境配置与初始化脚本细节 - 简化服务层方法命名,统一代码风格
22 lines
618 B
Python
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
|