(self)
| 179 | |
| 180 | @pytest.mark.asyncio |
| 181 | async def test_with_internal_tools(self): |
| 182 | from mcp_cli.chat.testing import TestChatContext |
| 183 | |
| 184 | tools = [_make_tool("t1", "Tool 1"), _make_tool("t2", "Tool 2")] |
| 185 | sm = _make_stream_manager(tools=tools, has_internal_tools=True) |
| 186 | mm = _make_model_manager() |
| 187 | ctx = TestChatContext(sm, mm) |
| 188 | |
| 189 | await ctx._initialize_tools() |
| 190 | |
| 191 | assert len(ctx.tools) == 2 |
| 192 | assert len(ctx.openai_tools) == 2 |
| 193 | assert ctx.openai_tools[0]["type"] == "function" |
| 194 | assert ctx.openai_tools[0]["function"]["name"] == "t1" |
| 195 | assert ctx.tool_to_server_map == {"t1": "test-server", "t2": "test-server"} |
| 196 | assert ctx.internal_tools == list(ctx.tools) |
| 197 | assert ctx.tool_name_mapping == {} |
| 198 | sm.get_server_info.assert_called_once() |
| 199 | |
| 200 | @pytest.mark.asyncio |
| 201 | async def test_falls_back_to_get_all_tools(self): |
nothing calls this directly
no test coverage detected