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:
Paul Gauthier 2023-06-01 08:49:39 -07:00
parent c97a0ce30a
commit 2b07a334cc

View file

@ -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)