mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 05:14:59 +00:00
aider: Fixed the setUp
method in the TestMain
class to correctly mock the check_for_model_availability
method.
# Context: USER: E AttributeError: <class 'aider.coder.Coder'> does not have the attribute 'check_for_model_availability' ASSISTANT: It seems like you are trying to access the `check_for_model_availability` method of the `Coder` class, but it is not defined as an instance method. To fix this issue, you need to move the `check_model_availability` method inside the `Coder` class and update the tests accordingly. Here are the changes you need to make: 1. Move the ` ^C KeyboardInterrupt USER: fix the `setUp` ASSISTANT: To fix the `setUp` method in the `TestMain` class, you need to update the way you are mocking the `check_for_model_availability` method. Here are the changes you need to make: 1. Modify the `setUp` method in the `TestMain` class to correctly mock the `check_for_model_availability` method of the `Coder` class. ```python tests/test_main.py <<<<<<< ORIGINAL with patch("aider.coder.Coder.check_for_model_availability") as mock_check: mock_check.return_value = True self.mock_check = mock_check ======= with patch("aider.coder.Coder.check_model_availability") as mock_check: mock_check.return_value = True self.mock_check = mock_check >>>>>>> UPDATED ``` This change will ensure that the `check_for_model_availability` method is correctly mocked during the tests.
This commit is contained in:
parent
fd70d9d63b
commit
1b49ba6e91
1 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ class TestMain(TestCase):
|
|||
self.tempdir = tempfile.mkdtemp()
|
||||
os.chdir(self.tempdir)
|
||||
|
||||
with patch("aider.coder.Coder.check_for_model_availability") as mock_check:
|
||||
with patch("aider.coder.Coder.check_model_availability") as mock_check:
|
||||
mock_check.return_value = True
|
||||
self.mock_check = mock_check
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue