Skip to content

Commit

Permalink
fix: Test check_gitignore with and without .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Dec 22, 2024
1 parent 8768a8a commit 350df7c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/basic/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,15 @@ def test_check_gitignore(self):

self.assertEqual(".aider*", gitignore.read_text().splitlines()[0])

# Test without .env file present
gitignore.write_text("one\ntwo\n")
check_gitignore(cwd, io)
self.assertEqual("one\ntwo\n.aider*\n", gitignore.read_text())

# Test with .env file present
env_file = cwd / ".env"
env_file.touch()
check_gitignore(cwd, io)
self.assertEqual("one\ntwo\n.aider*\n.env\n", gitignore.read_text())
del os.environ["GIT_CONFIG_GLOBAL"]

Expand Down

0 comments on commit 350df7c

Please sign in to comment.