fixed test for windows

This commit is contained in:
Paul Gauthier 2023-11-14 13:19:57 -08:00
parent 0f9053008a
commit 5dd7287ee3

View file

@ -113,9 +113,9 @@ class TestMain(TestCase):
self.assertEqual(".aider*", gitignore.read_text().splitlines()[0])
def test_check_gitignore(self):
with tempfile.NamedTemporaryFile() as temp_gitconfig:
os.environ['GIT_CONFIG_GLOBAL'] = temp_gitconfig.name
make_repo()
with GitTemporaryDirectory():
os.environ["GIT_CONFIG_GLOBAL"] = "globalgitconfig"
io = InputOutput(pretty=False, yes=True)
cwd = Path.cwd()
gitignore = cwd / ".gitignore"
@ -129,7 +129,7 @@ class TestMain(TestCase):
gitignore.write_text("one\ntwo\n")
check_gitignore(cwd, io)
self.assertEqual("one\ntwo\n.aider*\n", gitignore.read_text())
del os.environ['GIT_CONFIG_GLOBAL']
del os.environ["GIT_CONFIG_GLOBAL"]
def test_main_git_ignore(self):
cwd = Path().cwd()