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

Method test_tools_call_failure

tests/apps/test_bridge.py:104–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

102
103 @pytest.mark.asyncio
104 async def test_tools_call_failure(self):
105 bridge, tm = _make_bridge()
106 tm._next_result = FakeToolResult(False, error="timeout")
107
108 msg = json.dumps(
109 {
110 "jsonrpc": "2.0",
111 "id": 2,
112 "method": "tools/call",
113 "params": {"name": "broken-tool", "arguments": {"x": 1}},
114 }
115 )
116
117 resp = await bridge.handle_message(msg)
118 parsed = json.loads(resp)
119 assert parsed["id"] == 2
120 assert "error" in parsed
121 assert parsed["error"]["message"] == "timeout"
122
123 @pytest.mark.asyncio
124 async def test_resources_read(self):

Callers

nothing calls this directly

Calls 3

handle_messageMethod · 0.80
_make_bridgeFunction · 0.70
FakeToolResultClass · 0.70

Tested by

no test coverage detected