(
tool_name: str, arguments: dict[str, Any], namespace: str = ""
)
| 244 | self.error = None |
| 245 | |
| 246 | async def mock_execute( |
| 247 | tool_name: str, arguments: dict[str, Any], namespace: str = "" |
| 248 | ) -> FakeResult: |
| 249 | import datetime |
| 250 | |
| 251 | if tool_name == "echo": |
| 252 | return FakeResult({"echoed": arguments.get("message", "")}) |
| 253 | if tool_name == "get_time": |
| 254 | return FakeResult({"time": datetime.datetime.now().isoformat()}) |
| 255 | if tool_name == "calculate": |
| 256 | a = arguments.get("a", 0) |
| 257 | b = arguments.get("b", 0) |
| 258 | op = arguments.get("operation", "add") |
| 259 | ops = {"add": a + b, "subtract": a - b, "multiply": a * b} |
| 260 | return FakeResult({"result": ops.get(op, 0), "operation": op}) |
| 261 | return FakeResult({"error": f"Unknown tool: {tool_name}"}) |
| 262 | |
| 263 | tm.execute_tool = AsyncMock(side_effect=mock_execute) |
| 264 |
nothing calls this directly
no test coverage detected