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

Method test_cmd_commit

tests/basic/test_commands.py:442–462  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

440 commands.cmd_add("temp.txt")
441
442 def test_cmd_commit(self):
443 with GitTemporaryDirectory():
444 fname = "test.txt"
445 with open(fname, "w") as f:
446 f.write("test")
447 repo = git.Repo()
448 repo.git.add(fname)
449 repo.git.commit("-m", "initial")
450
451 io = InputOutput(pretty=False, fancy_input=False, yes=True)
452 coder = Coder.create(self.GPT35, None, io)
453 commands = Commands(io, coder)
454
455 self.assertFalse(repo.is_dirty())
456 with open(fname, "w") as f:
457 f.write("new")
458 self.assertTrue(repo.is_dirty())
459
460 commit_message = "Test commit message"
461 commands.cmd_commit(commit_message)
462 self.assertFalse(repo.is_dirty())
463
464 def test_cmd_add_from_outside_root(self):
465 with ChdirTemporaryDirectory() as tmp_dname:

Callers

nothing calls this directly

Calls 7

cmd_commitMethod · 0.95
InputOutputClass · 0.90
CommandsClass · 0.90
commitMethod · 0.80
createMethod · 0.80
is_dirtyMethod · 0.80

Tested by

no test coverage detected