mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-31 16:21:50 +03:00
feat(webui): add lightweight session messaging via mentions
This commit is contained in:
@@ -15,6 +15,21 @@ async def test_message_tool_returns_error_when_no_target_context() -> None:
|
||||
assert result == "Error: No target channel/chat specified"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_message_tool_preserves_legacy_positional_channel_arguments() -> None:
|
||||
sent: list[OutboundMessage] = []
|
||||
|
||||
async def send(message: OutboundMessage) -> None:
|
||||
sent.append(message)
|
||||
|
||||
tool = MessageTool(send_callback=send)
|
||||
await tool.execute("hello", "telegram", "chat-1")
|
||||
|
||||
assert [(message.channel, message.chat_id, message.content) for message in sent] == [
|
||||
("telegram", "chat-1", "hello")
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"bad",
|
||||
|
||||
Reference in New Issue
Block a user