mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
aider: Set return value of check_model_availability
to True
during test setup.
# Context: USER: the patch in `setUp` is not correcting forcing a return of true ASSISTANT: To fix the patch in `setUp`, you need to start the patch and set the return value to `True`. Here's the change you need to make in the `tests/test_main.py` file: ```python tests/test_main.py <<<<<<< ORIGINAL self.mock_check = patch("aider.main.Coder.check_model_availability") self.mock_check.return_value = True ======= with patch("aider.main.Coder.check_model_availability") as self.mock_check: self.mock_check.return_value = True super().setUp() >>>>>>> UPDATED ``` This change will ensure that the `check_model_availability` method returns `True` during the test setup.
This commit is contained in:
parent
c97a0ce30a
commit
2b07a334cc
1 changed files with 2 additions and 1 deletions
|
@ -21,8 +21,9 @@ class TestMain(TestCase):
|
|||
self.tempdir = tempfile.mkdtemp()
|
||||
os.chdir(self.tempdir)
|
||||
|
||||
self.mock_check = patch("aider.main.Coder.check_model_availability")
|
||||
with patch("aider.main.Coder.check_model_availability") as self.mock_check:
|
||||
self.mock_check.return_value = True
|
||||
super().setUp()
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(self.original_cwd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue