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

Method test_allowed_to_edit_no

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

Source from the content-addressed store, hash-verified

52 self.assertFalse(coder.need_commit_before_edits)
53
54 def test_allowed_to_edit_no(self):
55 with GitTemporaryDirectory():
56 repo = git.Repo()
57
58 fname = Path("added.txt")
59 fname.touch()
60 repo.git.add(str(fname))
61
62 fname = Path("repo.txt")
63 fname.touch()
64 repo.git.add(str(fname))
65
66 repo.git.commit("-m", "init")
67
68 # say NO
69 io = InputOutput(yes=False)
70
71 coder = Coder.create(self.GPT35, None, io, fnames=["added.txt"])
72
73 self.assertTrue(coder.allowed_to_edit("added.txt"))
74 self.assertFalse(coder.allowed_to_edit("repo.txt"))
75 self.assertFalse(coder.allowed_to_edit("new.txt"))
76
77 self.assertNotIn("repo.txt", str(coder.abs_fnames))
78 self.assertNotIn("new.txt", str(coder.abs_fnames))
79
80 self.assertFalse(coder.need_commit_before_edits)
81
82 def test_allowed_to_edit_dirty(self):
83 with GitTemporaryDirectory():

Callers

nothing calls this directly

Calls 5

InputOutputClass · 0.90
commitMethod · 0.80
createMethod · 0.80
allowed_to_editMethod · 0.80

Tested by

no test coverage detected