from fastapi.testclient import TestClient from finrep_algo_agent.main import app client = TestClient(app) def test_health() -> None: r = client.get("/health") assert r.status_code == 200 data = r.json() assert data["status"] == "ok" def test_outline_l1_stub() -> None: r = client.post( "/v1/outline/l1", json={"report_type": "项目融资", "chapter_candidates": [{"chapter_id": "a", "chapter_name": "测试章"}]}, ) assert r.status_code == 200 body = r.json() assert "chapter_results" in body assert len(body["chapter_results"]) >= 1 def test_section_stub() -> None: r = client.post( "/v1/section", json={"knowledge_unit_id": "ku-1", "template_type": "info"}, ) assert r.status_code == 200 assert "generated_text" in r.json()