Initial commit: 浼佷笟寰俊 AI 鏈哄櫒浜哄姪鐞?MVP
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
16
backend/tests/test_health.py
Normal file
16
backend/tests/test_health.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""Health 接口测试。"""
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
|
||||
def test_health():
|
||||
r = client.get("/api/health")
|
||||
assert r.status_code == 200
|
||||
data = r.json()
|
||||
assert data.get("code") == 0
|
||||
assert data.get("data", {}).get("status") == "up"
|
||||
assert "trace_id" in data
|
||||
Reference in New Issue
Block a user