mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
wip
This commit is contained in:
parent
99693fe614
commit
a5414473d9
1 changed files with 6 additions and 9 deletions
|
@ -13,26 +13,23 @@ from aider.main import main
|
|||
|
||||
|
||||
class TestMain(TestCase):
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
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()
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(self.original_cwd)
|
||||
shutil.rmtree(self.tempdir)
|
||||
|
||||
def test_main_with_empty_dir_no_files_on_command(self):
|
||||
pipe_input = create_input(StringIO(""))
|
||||
main([], input=pipe_input, output=DummyOutput())
|
||||
pipe_input.close()
|
||||
with patch("aider.main.Coder.check_model_availability") as mock_check:
|
||||
mock_check.return_value = True
|
||||
|
||||
pipe_input = create_input(StringIO(""))
|
||||
main([], input=pipe_input, output=DummyOutput())
|
||||
pipe_input.close()
|
||||
|
||||
def test_main_with_empty_dir_new_file(self):
|
||||
pipe_input = create_input(StringIO(""))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue