mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor: inject plugin interaction event publisher
This commit is contained in:
@@ -7,10 +7,14 @@ from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
|
||||
|
||||
from app.agent import AgentManager, _MessageTask, _async_start_processing_status
|
||||
from app.agent import ( # pylint: disable=no-name-in-module
|
||||
AgentManager,
|
||||
_MessageTask,
|
||||
_async_start_processing_status,
|
||||
)
|
||||
from app.chain.message import MessageChain
|
||||
from app.command import Command, _finish_command_processing_status
|
||||
from app.modules.telegram import TelegramModule
|
||||
from app.modules.telegram import TelegramModule # pylint: disable=no-name-in-module
|
||||
from app.modules.telegram.telegram import Telegram
|
||||
from app.runtime.config import global_vars
|
||||
from app.schemas.types import NotificationChannel
|
||||
@@ -259,6 +263,7 @@ class TestTelegramTypingLifecycle(unittest.TestCase):
|
||||
|
||||
def test_async_agent_leaves_processing_status_to_worker(self):
|
||||
chain = MessageChain.__new__(MessageChain)
|
||||
chain.eventmanager = Mock()
|
||||
chain.runtime_config = replace(
|
||||
chain.runtime_config,
|
||||
ai_agent_enable=True,
|
||||
@@ -373,6 +378,7 @@ class TestTelegramTypingLifecycle(unittest.TestCase):
|
||||
|
||||
def test_callback_stops_typing_when_message_handler_returns(self):
|
||||
chain = MessageChain.__new__(MessageChain)
|
||||
chain.eventmanager = Mock()
|
||||
status = MessageChain._ProcessingStatus(
|
||||
channel=NotificationChannel.Telegram,
|
||||
source="telegram-test",
|
||||
|
||||
Reference in New Issue
Block a user