MCPcopy
hub / github.com/Aider-AI/aider / test_cmd_ask

Method test_cmd_ask

tests/basic/test_commands.py:1809–1824  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 4

cmd_askMethod · 0.95
InputOutputClass · 0.90
CommandsClass · 0.90
createMethod · 0.80

Tested by

no test coverage detected