mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
refactor(schemas): 统一 message/notification 命名边界,旧名收敛至兼容映射表
- notification 域:渠道能力(MessageChannel→NotificationChannel、ChannelCapability* 迁入 notification.py) - message 域:消息收发(Notification→Message、NotificationType→MessageType、CommingMessage→IncomingMessage、NotificationHistoryItem→MessageHistoryItem、NotificationClear*→MessageClear*) - Agent 工具契约:send_notification_message→send_message、notification_callback→message_callback - 源码不保留旧名物理别名,旧导入经 app/runtime/compat/manifest.py SYMBOL_ALIASES 惰性解析 - API 路径与持久化键冻结不变,前端零改动 - 新增兼容守护测试与 docs/rules/07 命名边界规范
This commit is contained in:
@@ -3,7 +3,7 @@ import unittest
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from app.agent.tools.impl.add_subscribe import AddSubscribeTool
|
||||
from app.schemas.types import MessageChannel
|
||||
from app.schemas.types import NotificationChannel
|
||||
|
||||
|
||||
class TestAgentAddSubscribeTool(unittest.TestCase):
|
||||
@@ -19,7 +19,7 @@ class TestAgentAddSubscribeTool(unittest.TestCase):
|
||||
def test_tv_subscription_without_season_reports_default_first_season(self):
|
||||
tool = AddSubscribeTool(session_id="session-1", user_id="10001")
|
||||
tool.set_message_attr(
|
||||
channel=MessageChannel.Telegram.value,
|
||||
channel=NotificationChannel.Telegram.value,
|
||||
source="telegram-main",
|
||||
username="tg_display_name",
|
||||
)
|
||||
@@ -46,7 +46,7 @@ class TestAgentAddSubscribeTool(unittest.TestCase):
|
||||
def test_subscription_falls_back_to_channel_username_when_no_binding_exists(self):
|
||||
tool = AddSubscribeTool(session_id="session-1", user_id="10001")
|
||||
tool.set_message_attr(
|
||||
channel=MessageChannel.Telegram.value,
|
||||
channel=NotificationChannel.Telegram.value,
|
||||
source="telegram-main",
|
||||
username="tg_display_name",
|
||||
)
|
||||
@@ -72,7 +72,7 @@ class TestAgentAddSubscribeTool(unittest.TestCase):
|
||||
def test_feishu_subscription_uses_pre_resolved_username_when_openid_lookup_misses(self):
|
||||
tool = AddSubscribeTool(session_id="session-1", user_id="ou_feishu_user")
|
||||
tool.set_message_attr(
|
||||
channel=MessageChannel.Feishu.value,
|
||||
channel=NotificationChannel.Feishu.value,
|
||||
source="feishu-main",
|
||||
username="moviepilot-user",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user