这一批提交包含: 1. 配置项敏感字段标记与测试用例修复 2. 路由绑定乐观锁支持与静态路径校验 3. 微信WOC插件能力适配与新增单元测试 4. 多个适配器的接口对齐与测试补全 5. 新增定时任务清理处理器与依赖注入容器测试 6. 错误码体系扩展与整合测试 7. 删除临时验证脚本与代码清理
38 lines
1.7 KiB
Python
38 lines
1.7 KiB
Python
"""channels 模块集成测试共享 fixture 与常量。
|
||
|
||
父级 ``backend/test/integration/conftest.py`` 已提供 ``test_client``、
|
||
``admin_headers``、``standard_user``,本文件仅补充 channels 资源域所需的
|
||
路径常量、默认值与 payload 构造辅助函数。
|
||
|
||
由于真实渠道账户依赖外部 IM 平台凭据(飞书/钉钉等),测试环境通常无法
|
||
创建可用账户,因此业务路径测试统一使用 ``NON_EXISTENT_*`` 占位 ID,断言
|
||
404 / 501 / 422 等错误路径;列表类端点断言 200 与响应结构。
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
# channels 路由统一挂载在 /api/channels 下
|
||
BASE_URL = "/api/channels"
|
||
|
||
# 默认渠道类型(飞书),用于路径参数;不依赖真实适配器
|
||
DEFAULT_CHANNEL_TYPE = "feishu"
|
||
|
||
# 不存在的资源 ID,用于 404 / 状态机错误路径测试
|
||
NON_EXISTENT_ACCOUNT_ID = "nonexistent_account_00000000"
|
||
NON_EXISTENT_SESSION_ID = "nonexistent_session_00000000"
|
||
NON_EXISTENT_MESSAGE_ID = "nonexistent_message_00000000"
|
||
NON_EXISTENT_OUTBOX_ID = "nonexistent_outbox_00000000"
|
||
NON_EXISTENT_PAIRING_ID = "nonexistent_pairing_00000000"
|
||
NON_EXISTENT_PEER_ID = "nonexistent_peer_00000000"
|
||
NON_EXISTENT_GROUP_ID = "nonexistent_group_00000000"
|
||
NON_EXISTENT_PLUGIN_ID = "nonexistent_plugin_00000000"
|
||
NON_EXISTENT_CONFIG_KEY = "nonexistent_config_key_0000"
|
||
NON_EXISTENT_LOG_ID = "nonexistent_log_00000000"
|
||
NON_EXISTENT_CHECK_ID = "nonexistent_check_00000000"
|
||
NON_EXISTENT_REVIEW_ID = "nonexistent_review_00000000"
|
||
NON_EXISTENT_BINDING_ID = "nonexistent_binding_00000000"
|
||
|
||
# ISO 8601 时间字符串(用于 analytics / dashboard / audit 查询参数)
|
||
ISO_TIME_START = "2026-01-01T00:00:00Z"
|
||
ISO_TIME_END = "2026-07-01T00:00:00Z"
|