Test call_tool handles exceptions.
()
| 478 | |
| 479 | @pytest.mark.asyncio |
| 480 | async def test_call_tool_exception(): |
| 481 | """Test call_tool handles exceptions.""" |
| 482 | tools = [ |
| 483 | ToolInfo(name="test", namespace="test", description="Test tool", parameters={}), |
| 484 | ] |
| 485 | tool_manager = DummyToolManager(tools) |
| 486 | tool_manager.execute_tool = AsyncMock(side_effect=RuntimeError("network error")) |
| 487 | |
| 488 | provider = DynamicToolProvider(tool_manager) |
| 489 | # Must fetch schema first (enforced workflow) |
| 490 | await provider.get_tool_schema("test") |
| 491 | result = await provider.call_tool("test", {}) |
| 492 | |
| 493 | assert result["success"] is False |
| 494 | assert "network error" in result["error"] |
| 495 | |
| 496 | |
| 497 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected