mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 21:34:59 +00:00
fixed test
This commit is contained in:
parent
4956c35870
commit
124ab7dd99
1 changed files with 3 additions and 9 deletions
|
@ -2,8 +2,8 @@ import os
|
|||
import shutil
|
||||
import tempfile
|
||||
from unittest import TestCase
|
||||
from unittest.mock import patch
|
||||
|
||||
from aider import models
|
||||
from aider.commands import Commands
|
||||
from aider.io import InputOutput
|
||||
|
||||
|
@ -14,22 +14,16 @@ class TestCommands(TestCase):
|
|||
self.tempdir = tempfile.mkdtemp()
|
||||
os.chdir(self.tempdir)
|
||||
|
||||
self.patcher = patch("aider.coder.Coder.check_model_availability")
|
||||
self.mock_check = self.patcher.start()
|
||||
self.mock_check.return_value = True
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(self.original_cwd)
|
||||
shutil.rmtree(self.tempdir)
|
||||
|
||||
self.patcher.stop()
|
||||
|
||||
def test_cmd_add(self):
|
||||
# Initialize the Commands and InputOutput objects
|
||||
io = InputOutput(pretty=False, yes=True)
|
||||
from aider.coder import Coder
|
||||
from aider.coders import Coder
|
||||
|
||||
coder = Coder(io, openai_api_key="deadbeef")
|
||||
coder = Coder.create(models.GPT35, io, openai_api_key="deadbeef")
|
||||
commands = Commands(io, coder)
|
||||
|
||||
# Call the cmd_add method with 'foo.txt' and 'bar.txt' as a single string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue