fad458b2a7
- UIUX 文档:填充 19 个缺口(多主体画像/健康度/AI+看板/增长域/洞察域/创始人端/OODA/助推/商密) - UIUX 文档:插入 6 个新章节(十四~十九),旧章节重编号为二十~三十一,更新目录和交叉引用 - 作业指导书 x5:导航改为 6 域分组,新增 Context Bar/工作模式/Insight Rail/决策线程/多工作区等 UI 概念 - 新建 docs/2-task-uiux.md:50 个代码落地开发任务,按 P0-P6 分优先级 + 8 Sprint 规划 - 后端/前端:大量新增模型、路由、组件(来自之前 Phase 开发)
100 lines
3.5 KiB
Python
100 lines
3.5 KiB
Python
"""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
|