Files
FastapiAdmin/backend/tests/test_main.py
T
zhangtao d50dd9dd1e style: 移除Python文件中的编码声明并优化代码格式
refactor: 重构前端组件和样式,添加AI助手功能

docs: 更新README文档,添加ruff代码检查说明

feat: 新增AI助手相关API和前端组件

chore: 更新.gitignore文件,添加ruff缓存配置

fix: 修复前端布局和设置相关的问题

perf: 优化代码结构和性能,移除冗余代码

test: 更新测试文件,移除编码声明

build: 更新依赖版本,调整requirements.txt
2026-01-16 01:13:59 +08:00

23 lines
514 B
Python

"""
测试文件
注意:使用普通的 def 定义测试函数,不要使用 async def
执行命令: pytest tests/test.py
"""
import pytest
from fastapi.testclient import TestClient
def test_check_health(test_client: TestClient) -> None:
"""测试健康检查接口"""
response = test_client.get("/common/health")
assert response.status_code == 200
assert response.json() == {"msg": "Healthy"}
# 运行所有测试
if __name__ == "__main__":
pytest.main(["-v", "tests/test_main.py"])