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

Method test_cmd_git

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

Source from the content-addressed store, hash-verified

342 self.assertEqual(coder.abs_fnames, set())
343
344 def test_cmd_git(self):
345 # Initialize the Commands and InputOutput objects
346 io = InputOutput(pretty=False, fancy_input=False, yes=True)
347
348 with GitTemporaryDirectory() as tempdir:
349 # Create a file in the temporary directory
350 with open(f"{tempdir}/test.txt", "w") as f:
351 f.write("test")
352
353 coder = Coder.create(self.GPT35, None, io)
354 commands = Commands(io, coder)
355
356 # Run the cmd_git method with the arguments "commit -a -m msg"
357 commands.cmd_git("add test.txt")
358 commands.cmd_git("commit -a -m msg")
359
360 # Check if the file has been committed to the repository
361 repo = git.Repo(tempdir)
362 files_in_repo = repo.git.ls_files()
363 self.assertIn("test.txt", files_in_repo)
364
365 def test_cmd_tokens(self):
366 # Initialize the Commands and InputOutput objects

Callers

nothing calls this directly

Calls 5

cmd_gitMethod · 0.95
InputOutputClass · 0.90
CommandsClass · 0.90
createMethod · 0.80

Tested by

no test coverage detected