def test_ahead(self): rev = git_utils.get_latest_commit('master') commit_files(['file2.txt'], 'second commit') self.assertEqual(git_utils.get_merge_base('branch', 'master'), rev) self.assertEqual(git_utils.compare_branches('branch', 'master'), git_utils.BranchStatus.ahead)
def test_behind(self): rev = git_utils.get_latest_commit('master') check_call_silent(['git', 'checkout', 'master']) commit_files(['file2.txt'], 'second commit') self.assertEqual(git_utils.get_merge_base('branch', 'master'), rev) self.assertEqual(git_utils.compare_branches('branch', 'master'), git_utils.BranchStatus.behind)
def test_even(self): rev = git_utils.get_latest_commit('master') self.assertEqual(git_utils.get_merge_base('branch', 'master'), rev) self.assertEqual(git_utils.compare_branches('branch', 'master'), git_utils.BranchStatus.even)