(self)
| 1807 | self.assertEqual(context.exception.kwargs.get("edit_format"), "diff") |
| 1808 | |
| 1809 | def test_cmd_ask(self): |
| 1810 | io = InputOutput(pretty=False, fancy_input=False, yes=True) |
| 1811 | coder = Coder.create(self.GPT35, None, io) |
| 1812 | commands = Commands(io, coder) |
| 1813 | |
| 1814 | question = "What is the meaning of life?" |
| 1815 | canned_reply = "The meaning of life is 42." |
| 1816 | |
| 1817 | with mock.patch("aider.coders.Coder.run") as mock_run: |
| 1818 | mock_run.return_value = canned_reply |
| 1819 | |
| 1820 | with self.assertRaises(SwitchCoder): |
| 1821 | commands.cmd_ask(question) |
| 1822 | |
| 1823 | mock_run.assert_called_once() |
| 1824 | mock_run.assert_called_once_with(question) |
| 1825 | |
| 1826 | def test_cmd_lint_with_dirty_file(self): |
| 1827 | with GitTemporaryDirectory() as repo_dir: |
nothing calls this directly
no test coverage detected