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