ForcePilot/backend/test/integration/api/channels/conftest.py

38 lines
1.7 KiB
Python
Raw Normal View History

"""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"