"""冒烟测试:确认 FastAPI 应用可加载、健康检查可用。""" from __future__ import annotations from app.main import app from fastapi.testclient import TestClient client = TestClient(app) def test_health_ok() -> None: resp = client.get("/api/health") assert resp.status_code == 200 body = resp.json() assert body["status"] == "ok" assert body["app"] == "qlib-platform" assert body["version"] def test_openapi_available() -> None: resp = client.get("/openapi.json") assert resp.status_code == 200 assert resp.json()["info"]["title"] == "qlib-platform"