Test git.rebase
(self)
| 659 | |
| 660 | @pytest.mark.slow_test |
| 661 | def test_rebase(self): |
| 662 | """ |
| 663 | Test git.rebase |
| 664 | """ |
| 665 | # Switch to the second branch |
| 666 | self.assertNotIn( |
| 667 | "ERROR", |
| 668 | self.run_function("git.checkout", [self.repo], rev=self.branches[0]), |
| 669 | ) |
| 670 | # Make a change to a different file than the one modified in setUp |
| 671 | file_path = os.path.join(self.repo, self.files[1]) |
| 672 | with salt.utils.files.fopen(file_path, "a") as fp_: |
| 673 | fp_.write("Added a line\n") |
| 674 | # Commit the change |
| 675 | self.assertNotIn( |
| 676 | "ERROR", |
| 677 | self.run_function( |
| 678 | "git.commit", |
| 679 | [self.repo, f'"Added a line to {self.files[1]}"'], |
| 680 | filename=self.files[1], |
| 681 | ), |
| 682 | ) |
| 683 | # Switch to the second branch |
| 684 | self.assertNotIn( |
| 685 | "ERROR", |
| 686 | self.run_function("git.checkout", [self.repo], rev=self.branches[1]), |
| 687 | ) |
| 688 | # Perform the rebase. The commit should show a comment about |
| 689 | # self.files[0] being modified, as that is the file that was modified |
| 690 | # in the second branch in the setUp function |
| 691 | ret = self.run_function("git.rebase", [self.repo], opts="-vvv") |
| 692 | self.assertNotIn("ERROR", ret) |
| 693 | self.assertNotIn("up to date", ret) |
| 694 | |
| 695 | # Test for git.remote_get is in test_remotes |
| 696 |
nothing calls this directly
no test coverage detected