Return a mock ToolManager.
(tools=None, app_host=None)
| 52 | |
| 53 | |
| 54 | def _make_tool_manager(tools=None, app_host=None): |
| 55 | """Return a mock ToolManager.""" |
| 56 | tm = MagicMock() |
| 57 | tm.get_all_tools = AsyncMock(return_value=tools or []) |
| 58 | if app_host is None: |
| 59 | tm._app_host = None |
| 60 | # When _app_host is None, the code checks `tool_manager._app_host is None`. |
| 61 | # We don't need to set app_host on the mock. |
| 62 | else: |
| 63 | tm._app_host = app_host |
| 64 | tm.app_host = app_host |
| 65 | return tm |
| 66 | |
| 67 | |
| 68 | def _make_context(tool_manager=None): |
no outgoing calls
no test coverage detected