TBC/scripts/shared_data.py
d-robotics 633a797226 AutoFlow v2.0: 合并 Test (Robogo) + data-loop-automation (D-Cloud) 为统一平台
- 16 个业务模块,856 个测试用例,40 个 E2E 测试
- 单一 React 19 前端 + PlatformSwitcher 二合一切换
- Flask 后端支持 scenario/dcloud_module/dcloud_e2e/dcloud_all 四种任务类型
- E2E 测试面板:API 全链路(8条) + UI 点击(3条) + 分步测试(3个)
- SSE 实时日志流 + 飞书告警 + 定时调度
- 完整还原原 ToB 平台 TestPanel E2E 模块
2026-06-23 11:48:29 +08:00

32 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""测试数据预置 - 共享常量与工具函数
供 setup_test_data.py 和 setup_test_data_api.py 共用。
"""
import sys
import os
from pathlib import Path
# 确保项目根目录可导入(使 from tests.conftest_auth 生效)
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from tests.conftest_auth import _get_token_from_auth_state
AUTH_STATE_FILE = Path(__file__).parent.parent / ".auth" / "state.json"
# 预置测试文件
TEST_FILES = [
{"name": "test_file_1.txt", "content": "测试文件1 - 自动化测试数据"},
{"name": "test_file_2.txt", "content": "测试文件2 - 自动化测试数据"},
{"name": "test_file_3.txt", "content": "测试文件3 - 自动化测试数据"},
{"name": "test_image.jpg", "content": b"\xff\xd8\xff\xe0\x00\x10JFIF"},
]
# 预置测试文件夹
TEST_FOLDERS = ["test_folder_1", "test_folder_2"]
def get_token() -> str | None:
"""从认证状态文件获取 token(委托给 conftest_auth 的统一实现)。"""
return _get_token_from_auth_state()