當前位置: 首頁>>代碼示例>>Python>>正文


Python Coveralls.git_info方法代碼示例

本文整理匯總了Python中coveralls.Coveralls.git_info方法的典型用法代碼示例。如果您正苦於以下問題:Python Coveralls.git_info方法的具體用法?Python Coveralls.git_info怎麽用?Python Coveralls.git_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在coveralls.Coveralls的用法示例。


在下文中一共展示了Coveralls.git_info方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_git

# 需要導入模塊: from coveralls import Coveralls [as 別名]
# 或者: from coveralls.Coveralls import git_info [as 別名]
    def test_git(self):
        cover = Coveralls(repo_token='xxx')
        git_info = cover.git_info()
        commit_id = git_info['git']['head'].pop('id')

        assert re.match(r'^[a-f0-9]{40}$', commit_id)
        assert git_info == {'git': {
            'head': {
                'committer_email': '[email protected]',
                'author_email': '[email protected]',
                'author_name': 'Daniël',
                'message': 'first commit',
                'committer_name': 'Daniël',
            },
            'remotes': [{
                'url': 'https://github.com/username/Hello-World.git',
                'name': 'origin'
            }],
            'branch': 'master'
        }}
開發者ID:Jwpe,項目名稱:coveralls-python,代碼行數:22,代碼來源:test_api.py

示例2: test_git

# 需要導入模塊: from coveralls import Coveralls [as 別名]
# 或者: from coveralls.Coveralls import git_info [as 別名]
    def test_git(self):
        cover = Coveralls(repo_token='xxx')
        git_info = cover.git_info()
        commit_id = git_info['git']['head'].pop('id')
        self.assertTrue(re.match(r'^[a-f0-9]{40}$', commit_id))
        # expect(commit_id).should.match(r'^[a-f0-9]{40}$', re.I | re.U) sure 1.1.7 is broken for py2.6

        expect(git_info).should.be.equal({'git': {
            'head': {
                'committer_email': '[email protected]',
                'author_email': '[email protected]',
                'author_name': 'Guido',
                'message': 'first commit',
                'committer_name': 'Guido',
            },
            'remotes': [{
                'url': u'https://github.com/username/Hello-World.git',
                'name': u'origin'
            }],
            'branch': u'master'}})
開發者ID:asmeurer,項目名稱:coveralls-python,代碼行數:22,代碼來源:test_api.py


注:本文中的coveralls.Coveralls.git_info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。