mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-11 23:25:01 +00:00
test_main_git_ignore
This commit is contained in:
parent
0f14947a4c
commit
180ca7c464
2 changed files with 17 additions and 1 deletions
|
@ -80,6 +80,10 @@ class TestMain(TestCase):
|
|||
|
||||
self.assertTrue(git.Repo(self.tempdir))
|
||||
|
||||
gitignore = Path.cwd() / ".gitignore"
|
||||
self.assertTrue(gitignore.exists())
|
||||
self.assertEqual(".aider*", gitignore.read_text().splitlines()[0])
|
||||
|
||||
def test_check_gitignore(self):
|
||||
make_repo()
|
||||
io = InputOutput(pretty=False, yes=True)
|
||||
|
@ -96,6 +100,17 @@ class TestMain(TestCase):
|
|||
check_gitignore(cwd, io)
|
||||
self.assertEqual("one\ntwo\n.aider*\n", gitignore.read_text())
|
||||
|
||||
def test_main_git_ignore(self):
|
||||
cwd = Path().cwd()
|
||||
self.assertFalse((cwd / ".git").exists())
|
||||
self.assertFalse((cwd / ".gitignore").exists())
|
||||
|
||||
with patch("aider.main.Coder.create"):
|
||||
main(["--yes"], input=DummyInput())
|
||||
|
||||
self.assertTrue((cwd / ".git").exists())
|
||||
self.assertTrue((cwd / ".gitignore").exists())
|
||||
|
||||
def test_main_args(self):
|
||||
with patch("aider.main.Coder.create") as MockCoder:
|
||||
# --yes will just ok the git repo without blocking on input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue