示例#1
0
 def testDCOSignoffCheckMergeCommit(self):
     commit = Commit(self._mock_commit_merge, self._mock_repo)
     commit.git_commit_object.message = "has no signoff"
     self.assertTrue(
         commit.checkDCOSignoff(),
         "Commit message didn't have a signoff, but is a merge commit so that's ok"
     )
示例#2
0
    def testFoundNoPastDCOSignoff(self):
        commit = Commit(self._mock_commit, self._mock_repo)
        commit.git_commit_object.hexsha = 'c1d322dfba0ed7a770d74074990ac51a9efedcd0'
        commit.repo_object.past_signoffs = [
            "I, personname hereby sign-off-by all of my past commits to this repo subject to the Developer Certificate of Origin (DCO), Version 1.1. In the past I have used emails: [[email protected]]\n\n11ac960e1070eacc2fe92ac9a3d1753400e1fd4b This is a commit"
            .encode()
        ]

        self.assertFalse(commit.hasDCOPastSignoff(),
                         "Commit message had a past signoff")
示例#3
0
 def testDCOSignoffCheckNormalCommitNoSignoffPastSignoff(self):
     commit = Commit(self._mock_commit_merge, self._mock_repo)
     commit.git_commit_object.hexsha = '11ac960e1070eacc2fe92ac9a3d1753400e1fd4b'
     commit.repo_object.past_signoffs = [[
         'dco-signoffs',
         "I, personname hereby sign-off-by all of my past commits to this repo subject to the Developer Certificate of Origin (DCO), Version 1.1. In the past I have used emails: [[email protected]]\n\n11ac960e1070eacc2fe92ac9a3d1753400e1fd4b This is a commit"
         .encode()
     ]]
     commit.git_commit_object.message = "has no signoff"
     self.assertTrue(
         commit.checkDCOSignoff(),
         "Commit message didn't have a signoff, but it has a past DCO signoff so that's ok"
     )
示例#4
0
    def testDCOSignoffRequiredNormalCommit(self):
        commit = Commit(self._mock_commit, self._mock_repo)

        self.assertTrue(commit.isDCOSignOffRequired(),
                        "All non-merge commits require a DCO signoff")
示例#5
0
    def testDCOSignoffRequiredMergeCommit(self):
        commit = Commit(self._mock_commit_merge, self._mock_repo)

        self.assertFalse(commit.isDCOSignOffRequired(),
                         "Merge commits don't require a DCO signoff")
示例#6
0
 def testHasDCOSignOff(self):
     commit = Commit(self._mock_commit, self._mock_repo)
     commit.git_commit_object.message = "has a signoff  Signed-off-by: John Mertic <*****@*****.**>"
     self.assertTrue(commit.hasDCOSignOff(), "Commit message had a signoff")
示例#7
0
 def testHasNoDCOSignOff(self):
     commit = Commit(self._mock_commit, self._mock_repo)
     commit.git_commit_object.message = "has no signoff"
     self.assertFalse(commit.hasDCOSignOff(),
                      "Commit message didn't have a signoff")