fix(awooop): label outbound timeline events
This commit is contained in:
37
apps/api/tests/test_awooop_operator_timeline_labels.py
Normal file
37
apps/api/tests/test_awooop_operator_timeline_labels.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from src.services.platform_operator_service import _outbound_timeline_title
|
||||
|
||||
|
||||
def test_outbound_timeline_title_labels_runbook_review() -> None:
|
||||
title = _outbound_timeline_title(
|
||||
"telegram",
|
||||
"approval_request",
|
||||
"📄 <b>RUNBOOK REVIEW|待審核</b>\nIncident:INC-1",
|
||||
)
|
||||
|
||||
assert title == "TELEGRAM:Runbook 待人工審核"
|
||||
|
||||
|
||||
def test_outbound_timeline_title_labels_governance_alert() -> None:
|
||||
title = _outbound_timeline_title(
|
||||
"telegram",
|
||||
"final",
|
||||
"⚠️ *AI 治理警報|知識庫劣化*",
|
||||
)
|
||||
|
||||
assert title == "TELEGRAM:AI 治理警報"
|
||||
|
||||
|
||||
def test_outbound_timeline_title_labels_auto_repair_handoff() -> None:
|
||||
title = _outbound_timeline_title(
|
||||
"telegram",
|
||||
"error",
|
||||
"🤖❌ HANDOFF REQUIRED|AI 自動修復失敗,已轉人工",
|
||||
)
|
||||
|
||||
assert title == "TELEGRAM:AI 自動修復失敗,已轉人工"
|
||||
|
||||
|
||||
def test_outbound_timeline_title_falls_back_to_human_label() -> None:
|
||||
title = _outbound_timeline_title("telegram", "interim", "正在調用 MCP 工具")
|
||||
|
||||
assert title == "TELEGRAM:漸進式狀態回饋"
|
||||
Reference in New Issue
Block a user