Skip to content

Commit 7563728

Browse files
committed
test: Update tests for git integration
1 parent 6aa05ab commit 7563728

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

tests/basic/test_coder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ def test_skip_aiderignored_files(self):
836836

837837
def test_skip_gitignored_files_on_init(self):
838838
with GitTemporaryDirectory() as tmpdir:
839-
repo_path = Path(tmpdir)
839+
repo_path = Path(".")
840840
repo = git.Repo.init(repo_path)
841841

842842
ignored_file = repo_path / "ignored_by_git.txt"
@@ -856,7 +856,7 @@ def test_skip_gitignored_files_on_init(self):
856856

857857
fnames_to_add = [str(ignored_file), str(regular_file)]
858858

859-
coder = Coder.create(self.GPT35, None, mock_io, fnames=fnames_to_add, repo=repo)
859+
coder = Coder.create(self.GPT35, None, mock_io, fnames=fnames_to_add)
860860

861861
self.assertNotIn(str(ignored_file.resolve()), coder.abs_fnames)
862862
self.assertIn(str(regular_file.resolve()), coder.abs_fnames)

tests/basic/test_main.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,18 +1363,3 @@ def test_cache_without_stream_no_warning(self, MockInputOutput):
13631363
)
13641364
for call in mock_io_instance.tool_warning.call_args_list:
13651365
self.assertNotIn("Cost estimates may be inaccurate", call[0][0])
1366-
1367-
def test_argv_file_respects_git(self):
1368-
with GitTemporaryDirectory():
1369-
fname = Path("not_in_git.txt")
1370-
fname.touch()
1371-
with open(".gitignore", "w+") as f:
1372-
f.write("not_in_git.txt")
1373-
coder = main(
1374-
argv=["--file", "not_in_git.txt"],
1375-
input=DummyInput(),
1376-
output=DummyOutput(),
1377-
return_coder=True,
1378-
)
1379-
self.assertNotIn("not_in_git.txt", str(coder.abs_fnames))
1380-
self.assertFalse(coder.allowed_to_edit("not_in_git.txt"))

0 commit comments

Comments
 (0)