MCPcopy
hub / github.com/Aider-AI/aider / test_skip_gitignored_files_on_init

Method test_skip_gitignored_files_on_init

tests/basic/test_coder.py:837–865  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

835 self.assertNotIn(fname3, str(coder.abs_fnames))
836
837 def test_skip_gitignored_files_on_init(self):
838 with GitTemporaryDirectory() as _:
839 repo_path = Path(".")
840 repo = git.Repo.init(repo_path)
841
842 ignored_file = repo_path / "ignored_by_git.txt"
843 ignored_file.write_text("This file should be ignored by git.")
844
845 regular_file = repo_path / "regular_file.txt"
846 regular_file.write_text("This is a regular file.")
847
848 gitignore_content = "ignored_by_git.txt\n"
849 (repo_path / ".gitignore").write_text(gitignore_content)
850
851 repo.index.add([str(regular_file), ".gitignore"])
852 repo.index.commit("Initial commit with gitignore and regular file")
853
854 mock_io = MagicMock()
855 mock_io.tool_warning = MagicMock()
856
857 fnames_to_add = [str(ignored_file), str(regular_file)]
858
859 coder = Coder.create(self.GPT35, None, mock_io, fnames=fnames_to_add)
860
861 self.assertNotIn(str(ignored_file.resolve()), coder.abs_fnames)
862 self.assertIn(str(regular_file.resolve()), coder.abs_fnames)
863 mock_io.tool_warning.assert_any_call(
864 f"Skipping {ignored_file.name} that matches gitignore spec."
865 )
866
867 def test_check_for_urls(self):
868 io = InputOutput(yes=True)

Callers

nothing calls this directly

Calls 5

write_textMethod · 0.80
commitMethod · 0.80
createMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected