MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_prompt_basic

Method test_prompt_basic

tests/commands/cmd/test_cmd_command.py:190–205  ·  view source on GitHub ↗
(self, cmd)

Source from the content-addressed store, hash-verified

188
189 @pytest.mark.asyncio
190 async def test_prompt_basic(self, cmd):
191 ctx = _make_context()
192 mock_client = MagicMock()
193 mock_client.create_completion = AsyncMock(
194 return_value={"response": "Hello!", "tool_calls": []}
195 )
196 ctx.model_manager.get_client.return_value = mock_client
197
198 with patch(_GET_CONTEXT, return_value=ctx):
199 with patch("builtins.print") as mock_print:
200 result = await cmd.execute(
201 prompt="hi", model_manager=ctx.model_manager
202 )
203 assert result.success is True
204 assert result.data == "Hello!"
205 mock_print.assert_called_once_with("Hello!")
206
207 @pytest.mark.asyncio
208 async def test_stdin_input(self, cmd):

Callers

nothing calls this directly

Calls 2

_make_contextFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected