(self)
| 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 |
nothing calls this directly
no test coverage detected