Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_revert_commit(self):
- self.git_commit('Test commit')
- self.git_commit('Revert "Test commit"\n\n'
- 'This reverts commit <sha>\n')
- self.assertEqual(self.run_uut(),
- ['Revert commit does not have a reason.'])
- self.assert_no_msgs()
- self.assertEqual(self.run_uut(allow_revert_commits=True),
- [])
- self.assert_no_msgs()
- self.git_commit('Test commit')
- self.git_commit('Revert "New Test commit"\n\n'
- 'This reverts commit <sha>\n\n'
- 'Reason for the revert commit is explained here.\n')
- self.assertEqual(self.run_uut(),
- ['Shortlog of revert commit does not match the original commit.'])
- self.assert_no_msgs()
- self.git_commit('Test commit')
- self.git_commit('Revert "Test commit"\n\n'
- 'This reverts commit <sha1>\n\n'
- 'This revert commit has wrong commit hash.\n')
- self.assertEqual(self.run_uut(),
- ['Invalid revert commit.'])
- self.assert_no_msgs()
- self.git_commit('Test commit')
- self.git_commit('Revert "Test commit"\n\n'
- 'This reverts commit <sha>\n\n'
- 'Reason for the revert commit is explained here'
- 'This reason is too long'
- 'Reason for the revert commit must not exceed 50 characters\n')
- self.assertEqual(self.run_uut(),
- ['Reason of revert is too long.'])
- self.assert_no_msgs()
- self.git_commit('Test commit')
- self.git_commit('Revert "Test commit"\n\n'
- 'This reverts commit <sha>\n\n'
- 'Reason for the revert commit is explained here.\n')
- self.assertEqual(self.run_uut(), [])
- self.assert_no_msgs()
Add Comment
Please, Sign In to add comment