Test call_tool handles tool execution failure.
()
| 454 | |
| 455 | @pytest.mark.asyncio |
| 456 | async def test_call_tool_failure(): |
| 457 | """Test call_tool handles tool execution failure.""" |
| 458 | tools = [ |
| 459 | ToolInfo(name="test", namespace="test", description="Test tool", parameters={}), |
| 460 | ] |
| 461 | tool_manager = DummyToolManager(tools) |
| 462 | tool_manager.execute_tool = AsyncMock( |
| 463 | return_value=ToolCallResult( |
| 464 | tool_name="test", |
| 465 | success=False, |
| 466 | error="execution failed", |
| 467 | ) |
| 468 | ) |
| 469 | |
| 470 | provider = DynamicToolProvider(tool_manager) |
| 471 | # Must fetch schema first (enforced workflow) |
| 472 | await provider.get_tool_schema("test") |
| 473 | result = await provider.call_tool("test", {}) |
| 474 | |
| 475 | assert result["success"] is False |
| 476 | assert result["error"] == "execution failed" |
| 477 | |
| 478 | |
| 479 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected