mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
tests and bugfix
This commit is contained in:
parent
957f59c011
commit
c8f1c0609d
3 changed files with 37 additions and 6 deletions
|
@ -44,6 +44,33 @@ class TestMain(TestCase):
|
|||
main(["--yes", "foo.txt"], input=DummyInput(), output=DummyOutput())
|
||||
self.assertTrue(os.path.exists("foo.txt"))
|
||||
|
||||
@patch("aider.repo.GitRepo.get_commit_message", return_value="mock commit message")
|
||||
def test_main_with_empty_git_dir_new_files(self, _):
|
||||
make_repo()
|
||||
main(["--yes", "foo.txt", "bar.txt"], input=DummyInput(), output=DummyOutput())
|
||||
self.assertTrue(os.path.exists("foo.txt"))
|
||||
self.assertTrue(os.path.exists("bar.txt"))
|
||||
|
||||
def test_main_with_dname_and_fname(self):
|
||||
subdir = Path("subdir")
|
||||
subdir.mkdir()
|
||||
make_repo(str(subdir))
|
||||
res = main(["subdir", "foo.txt"], input=DummyInput(), output=DummyOutput())
|
||||
self.assertNotEqual(res, None)
|
||||
|
||||
@patch("aider.repo.GitRepo.get_commit_message", return_value="mock commit message")
|
||||
def test_main_with_subdir_repo_fnames(self, _):
|
||||
subdir = Path("subdir")
|
||||
subdir.mkdir()
|
||||
make_repo(str(subdir))
|
||||
main(
|
||||
["--yes", str(subdir / "foo.txt"), str(subdir / "bar.txt")],
|
||||
input=DummyInput(),
|
||||
output=DummyOutput(),
|
||||
)
|
||||
self.assertTrue((subdir / "foo.txt").exists())
|
||||
self.assertTrue((subdir / "bar.txt").exists())
|
||||
|
||||
def test_main_with_git_config_yml(self):
|
||||
make_repo()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue