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

Method test_handler_catches_exceptions

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

Source from the content-addressed store, hash-verified

158
159 @pytest.mark.asyncio
160 async def test_handler_catches_exceptions(self):
161 mgr = MagicMock()
162 mgr.stop_agent = AsyncMock(side_effect=RuntimeError("boom"))
163 result = await handle_agent_tool("agent_stop", {"agent_id": "a1"}, mgr)
164 data = json.loads(result)
165 assert "error" in data
166 assert "boom" in data["error"]

Callers

nothing calls this directly

Calls 1

handle_agent_toolFunction · 0.90

Tested by

no test coverage detected