(self)
| 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): |
nothing calls this directly
no test coverage detected