from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_user_guide_covers_startup_acceptance_no_exports_and_troubleshooting(): content = (ROOT / "docs" / "UserGuide.md").read_text(encoding="utf-8") for required in [ "docker compose up -d --build", "http://localhost:8000", "1 × 1 × 10", "5 × 5 × 50", "文件导出", "已关闭 CSV / Markdown 文件下载入口和接口", "页面不展示 CSV / Markdown 下载入口", "8000 端口被占用", "API Key 缺失", "任务长期 running", "重置本地数据库", "公网云服务器部署", "python -m app.demo_seed", "data/corrupt-backups", ]: assert required in content def test_deployment_doc_requires_public_access_decisions_before_going_online(): content = (ROOT / "docs" / "Deployment.md").read_text(encoding="utf-8") for required in [ "上线前必须确认", "部署方式", "访问密码", "真实 TikHub 和 AI Key", "未经确认不要直接开放公网", ]: assert required in content assert "第一版公网演示使用云服务器 + Docker Compose,不增加登录或密码" not in content