feat(api): 添加睡眠评估端点 /api/sleep/assessment

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-27 16:22:55 +08:00
parent e1cef3ab4b
commit 211c2c2c4e
2 changed files with 152 additions and 0 deletions

View File

@@ -328,3 +328,14 @@ def test_nutrition_recommendations_endpoint(client):
assert "today_intake" in data
assert "gaps" in data
assert "suggestions" in data
def test_sleep_assessment_endpoint(client):
"""测试睡眠评估 API"""
response = client.get("/api/sleep/assessment")
assert response.status_code == 200
data = response.json()
assert "avg_duration" in data
assert "status" in data
assert "health_impacts" in data
assert "ideal_days_count" in data