(self, cmd, tmp_path)
| 239 | |
| 240 | @pytest.mark.asyncio |
| 241 | async def test_input_file_read(self, cmd, tmp_path): |
| 242 | input_file = tmp_path / "input.txt" |
| 243 | input_file.write_text("test data") |
| 244 | |
| 245 | ctx = _make_context() |
| 246 | mock_client = MagicMock() |
| 247 | mock_client.create_completion = AsyncMock( |
| 248 | return_value={"response": "analyzed", "tool_calls": []} |
| 249 | ) |
| 250 | ctx.model_manager.get_client.return_value = mock_client |
| 251 | |
| 252 | with patch(_GET_CONTEXT, return_value=ctx): |
| 253 | with patch("builtins.print"): |
| 254 | result = await cmd.execute( |
| 255 | input_file=str(input_file), |
| 256 | model_manager=ctx.model_manager, |
| 257 | ) |
| 258 | assert result.success is True |
| 259 | # Check that input text was used in the prompt |
| 260 | call_kwargs = mock_client.create_completion.call_args |
| 261 | messages = call_kwargs.kwargs.get("messages") or call_kwargs[1].get("messages") |
| 262 | assert "test data" in messages[-1]["content"] |
| 263 | |
| 264 | |
| 265 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected