Files
awoooi/apps/api/tests/test_notification_matrix_group_cutover.py
Your Name ee2cc2bfc3
Some checks failed
CD Pipeline / tests (push) Failing after 1m23s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Code Review / ai-code-review (push) Successful in 15s
fix(alerts): 收斂 Telegram 告警到 SRE 戰情室
2026-06-12 11:06:16 +08:00

32 lines
769 B
Python

from src.services.notification_matrix import resolve_chat_ids
def test_all_alert_types_resolve_to_sre_group_first() -> None:
for notification_type in [
"TYPE-1",
"TYPE-2",
"TYPE-3",
"TYPE-4",
"TYPE-4D",
"TYPE-5S",
"TYPE-6B",
"TYPE-7E",
"TYPE-8M",
"UNKNOWN",
]:
assert resolve_chat_ids(
notification_type,
dm_chat_id="5619078117",
group_chat_id="-1003711974679",
tg_group_cutover=False,
) == ["-1003711974679"]
def test_dm_is_not_used_when_group_missing() -> None:
assert resolve_chat_ids(
"TYPE-3",
dm_chat_id="5619078117",
group_chat_id="",
tg_group_cutover=True,
) == []