Mock tool manager for testing DynamicToolProvider.
| 24 | |
| 25 | |
| 26 | class DummyToolManager: |
| 27 | """Mock tool manager for testing DynamicToolProvider.""" |
| 28 | |
| 29 | def __init__(self, tools=None): |
| 30 | self.tools = tools or [] |
| 31 | self.execute_tool = AsyncMock( |
| 32 | return_value=ToolCallResult( |
| 33 | tool_name="test", success=True, result={"data": "ok"} |
| 34 | ) |
| 35 | ) |
| 36 | |
| 37 | async def get_all_tools(self): |
| 38 | return self.tools |
| 39 | |
| 40 | def format_tool_response(self, response): |
| 41 | import json |
| 42 | |
| 43 | if isinstance(response, dict): |
| 44 | return json.dumps(response) |
| 45 | if isinstance(response, list): |
| 46 | return json.dumps(response) |
| 47 | return str(response) |
| 48 | |
| 49 | |
| 50 | # ──────────────────────────────────────────────────────────────────── |
no outgoing calls