MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_agent_message

Method test_agent_message

tests/agents/test_tools.py:79–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

77
78 @pytest.mark.asyncio
79 async def test_agent_message(self):
80 mgr = MagicMock()
81 mgr.send_message = AsyncMock(return_value=True)
82 result = await handle_agent_tool(
83 "agent_message",
84 {"agent_id": "a1", "content": "hello"},
85 mgr,
86 caller_agent_id="supervisor",
87 )
88 data = json.loads(result)
89 assert data["success"] is True
90 mgr.send_message.assert_awaited_once_with("supervisor", "a1", "hello")
91
92 @pytest.mark.asyncio
93 async def test_agent_message_missing_fields(self):

Callers

nothing calls this directly

Calls 1

handle_agent_toolFunction · 0.90

Tested by

no test coverage detected