示例#1
0
    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)
示例#2
0
    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)
示例#3
0
 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)