mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
test: replace real-looking WhatsApp jid in regression test
This commit is contained in:
@@ -400,20 +400,21 @@ class TestSendToPlatformChunking:
|
|||||||
|
|
||||||
class TestSendToPlatformWhatsapp:
|
class TestSendToPlatformWhatsapp:
|
||||||
def test_whatsapp_routes_via_local_bridge_sender(self):
|
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"})
|
chat_id = "test-user@lid"
|
||||||
|
async_mock = AsyncMock(return_value={"success": True, "platform": "whatsapp", "chat_id": chat_id, "message_id": "abc123"})
|
||||||
|
|
||||||
with patch("tools.send_message_tool._send_whatsapp", async_mock):
|
with patch("tools.send_message_tool._send_whatsapp", async_mock):
|
||||||
result = asyncio.run(
|
result = asyncio.run(
|
||||||
_send_to_platform(
|
_send_to_platform(
|
||||||
Platform.WHATSAPP,
|
Platform.WHATSAPP,
|
||||||
SimpleNamespace(enabled=True, token=None, extra={"bridge_port": 3000}),
|
SimpleNamespace(enabled=True, token=None, extra={"bridge_port": 3000}),
|
||||||
"43121572348102@lid",
|
chat_id,
|
||||||
"hello from hermes",
|
"hello from hermes",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["success"] is True
|
assert result["success"] is True
|
||||||
async_mock.assert_awaited_once_with({"bridge_port": 3000}, "43121572348102@lid", "hello from hermes")
|
async_mock.assert_awaited_once_with({"bridge_port": 3000}, chat_id, "hello from hermes")
|
||||||
|
|
||||||
|
|
||||||
class TestSendTelegramHtmlDetection:
|
class TestSendTelegramHtmlDetection:
|
||||||
|
|||||||
Reference in New Issue
Block a user