"""T3.5 创始人 AI 副驾驶完整版测试。""" import pytest from fastapi.testclient import TestClient class TestFounderFinancingPlan: """融资规划接口测试。""" def test_financing_plan_success(self, client: TestClient, auth_headers: dict): """AI 生成融资规划。""" resp = client.post( "/api/v1/founder/financing-plan", json={"company_data": "AI 教育公司,年营收 500 万,寻求 A 轮融资"}, headers=auth_headers, ) assert resp.status_code == 200 assert isinstance(resp.json()["data"], dict) def test_financing_plan_no_auth(self, client: TestClient): """未认证应返回 401。""" resp = client.post("/api/v1/founder/financing-plan", json={}) assert resp.status_code == 401 def test_financing_plan_empty_body(self, client: TestClient, auth_headers: dict): """空请求体应正常返回。""" resp = client.post( "/api/v1/founder/financing-plan", json={"company_data": ""}, headers=auth_headers, ) assert resp.status_code == 200 class TestFounderOrgDiagnostic: """组织诊断接口测试。""" def test_org_diagnostic_success(self, client: TestClient, auth_headers: dict): """AI 组织诊断。""" resp = client.post( "/api/v1/founder/org-diagnostic", json={"team_data": "团队 30 人,CTO 空缺,前端工程师流失率较高"}, headers=auth_headers, ) assert resp.status_code == 200 assert isinstance(resp.json()["data"], dict) def test_org_diagnostic_no_auth(self, client: TestClient): """未认证应返回 401。""" resp = client.post("/api/v1/founder/org-diagnostic", json={}) assert resp.status_code == 401 class TestFounderInvestorCommPrep: """投资人沟通准备接口测试。""" def test_investor_comm_prep_success(self, client: TestClient, auth_headers: dict): """AI 投资人沟通准备。""" resp = client.post( "/api/v1/founder/investor-comm-prep", json={"board_context": "季度董事会,需要汇报进展和下一阶段计划"}, headers=auth_headers, ) assert resp.status_code == 200 assert isinstance(resp.json()["data"], dict) def test_investor_comm_prep_no_auth(self, client: TestClient): """未认证应返回 401。""" resp = client.post("/api/v1/founder/investor-comm-prep", json={}) assert resp.status_code == 401 class TestFounderOverview: """创始人概览接口测试。""" def test_overview_success(self, client: TestClient, auth_headers: dict): """获取创始人经营概览。""" resp = client.get("/api/v1/founder/overview", headers=auth_headers) assert resp.status_code == 200 assert "data" in resp.json() def test_overview_no_auth(self, client: TestClient): """未认证应返回 401。""" resp = client.get("/api/v1/founder/overview") assert resp.status_code == 401 class TestFounderHealth: """创始人健康度接口测试。""" def test_health_success(self, client: TestClient, auth_headers: dict): """获取创始人自身健康度。""" resp = client.get("/api/v1/founder/health", headers=auth_headers) assert resp.status_code == 200 def test_health_no_auth(self, client: TestClient): """未认证应返回 401。""" resp = client.get("/api/v1/founder/health") assert resp.status_code == 401