import pytest from httpx import AsyncClient, ASGITransport from app.main import app @pytest.mark.asyncio async def test_tongue_diagnose_missing_file(): """无文件上传应返回 422""" transport = ASGITransport(app=app) async with AsyncClient(transport=transport, base_url="http://test") as client: resp = await client.post("/api/v1/tongue/diagnose", data={"user_id": 1}) assert resp.status_code == 422