Test processing a simple text response.
(self)
| 173 | |
| 174 | @pytest.mark.asyncio |
| 175 | async def test_simple_response(self): |
| 176 | """Test processing a simple text response.""" |
| 177 | context = MockContext() |
| 178 | context.conversation_history = [Message(role=MessageRole.USER, content="Hello")] |
| 179 | context.openai_tools = [] |
| 180 | |
| 181 | # Mock client response |
| 182 | context.client.create_completion = AsyncMock( |
| 183 | return_value={"response": "Hello! How can I help?", "tool_calls": None} |
| 184 | ) |
| 185 | |
| 186 | ui_manager = MockUIManager() |
| 187 | ui_manager.print_assistant_message = AsyncMock() |
| 188 | |
| 189 | processor = ConversationProcessor(context, ui_manager) |
| 190 | await processor.process_conversation() |
| 191 | |
| 192 | # Should have added assistant message to history |
| 193 | assert len(context.conversation_history) == 2 |
| 194 | assert context.conversation_history[-1].role == MessageRole.ASSISTANT |
| 195 | assert "Hello" in context.conversation_history[-1].content |
| 196 | |
| 197 | @pytest.mark.asyncio |
| 198 | async def test_max_turns_limit(self): |
nothing calls this directly
no test coverage detected