mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(tools): add outbound WhatsApp send_message routing
This commit is contained in:
parent
548cedb869
commit
dc15bc508f
2 changed files with 48 additions and 0 deletions
|
|
@ -398,6 +398,24 @@ class TestSendToPlatformChunking:
|
|||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestSendToPlatformWhatsapp:
|
||||
def test_whatsapp_routes_via_local_bridge_sender(self):
|
||||
async_mock = AsyncMock(return_value={"success": True, "platform": "whatsapp", "chat_id": "43121572348102@lid", "message_id": "abc123"})
|
||||
|
||||
with patch("tools.send_message_tool._send_whatsapp", async_mock):
|
||||
result = asyncio.run(
|
||||
_send_to_platform(
|
||||
Platform.WHATSAPP,
|
||||
SimpleNamespace(enabled=True, token=None, extra={"bridge_port": 3000}),
|
||||
"43121572348102@lid",
|
||||
"hello from hermes",
|
||||
)
|
||||
)
|
||||
|
||||
assert result["success"] is True
|
||||
async_mock.assert_awaited_once_with({"bridge_port": 3000}, "43121572348102@lid", "hello from hermes")
|
||||
|
||||
|
||||
class TestSendTelegramHtmlDetection:
|
||||
"""Verify that messages containing HTML tags are sent with parse_mode=HTML
|
||||
and that plain / markdown messages use MarkdownV2."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue