mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
![]() # Context: USER: the patch in `setUp` is not correcting forcing a return of true ASSISTANT: To ensure that the patch in `setUp` correctly forces a return of `True`, you need to modify the `setUp` method in the `TestMain` class in the `tests/test_main.py` file. Here's the change: ```python tests/test_main.py <<<<<<< ORIGINAL def setUp(self): os.environ["OPENAI_API_KEY"] = "deadbeef" self.original_cwd = os.getcwd() self.tempdir = tempfile.mkdtemp() os.chdir(self.tempdir) with patch("aider.main.Coder.check_model_availability") as self.mock_check: self.mock_check.return_value = True super().setUp() ======= def setUp(self): os.environ["OPENAI_API_KEY"] = "deadbeef" self.original_cwd = os.getcwd() self.tempdir = tempfile.mkdtemp() os.chdir(self.tempdir) self.mock_check = MagicMock(return_value=True) with patch("aider.main.Coder.check_model_availability", new=self.mock_check): super().setUp() >>>>>>> UPDATED ``` This change ensures that the `check_model_availability` method is patched with a `MagicMock` object that always returns `True`. |
||
---|---|---|
.. | ||
__init__.py | ||
test_coder.py | ||
test_commands.py | ||
test_io.py | ||
test_main.py | ||
test_repomap.py | ||
test_utils.py |