Loop processes a normal prompt via ConversationProcessor.
(self)
| 91 | |
| 92 | @pytest.mark.asyncio |
| 93 | async def test_processes_prompt(self): |
| 94 | """Loop processes a normal prompt via ConversationProcessor.""" |
| 95 | ctx = _make_context() |
| 96 | ui = _make_ui() |
| 97 | q: asyncio.Queue = asyncio.Queue() |
| 98 | done = asyncio.Event() |
| 99 | |
| 100 | await q.put("Hello agent") |
| 101 | await q.put("exit") |
| 102 | |
| 103 | mock_convo = MagicMock() |
| 104 | mock_convo.process_conversation = AsyncMock() |
| 105 | |
| 106 | with patch( |
| 107 | "mcp_cli.chat.conversation.ConversationProcessor", |
| 108 | return_value=mock_convo, |
| 109 | ): |
| 110 | await run_agent_loop(ctx, ui, q, done) |
| 111 | |
| 112 | ctx.add_user_message.assert_called_once_with("Hello agent") |
| 113 | mock_convo.process_conversation.assert_called_once() |
| 114 | assert done.is_set() |
| 115 | |
| 116 | @pytest.mark.asyncio |
| 117 | async def test_captures_last_response(self): |
nothing calls this directly
no test coverage detected