当前位置: 首页>>代码示例>>Python>>正文


Python ComponentTestGitRepository._git_getoutput方法代码示例

本文整理汇总了Python中tests.component.ComponentTestGitRepository._git_getoutput方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentTestGitRepository._git_getoutput方法的具体用法?Python ComponentTestGitRepository._git_getoutput怎么用?Python ComponentTestGitRepository._git_getoutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.component.ComponentTestGitRepository的用法示例。


在下文中一共展示了ComponentTestGitRepository._git_getoutput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_create_branches

# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import _git_getoutput [as 别名]
    def test_create_branches(self):
        """Test if creating missing branches works"""
        def _dsc(version):
            return os.path.join(DEB_TEST_DATA_DIR,
                                'dsc-3.0',
                                'hello-debhelper_%s.dsc' % version)

        dsc = _dsc('2.6-2')
        assert import_dsc(['arg0',
                           '--verbose',
                           '--pristine-tar',
                           '--debian-branch=master',
                           '--upstream-branch=upstream',
                           dsc]) == 0
        repo = ComponentTestGitRepository('hello-debhelper')
        os.chdir('hello-debhelper')
        assert len(repo.get_commits()) == 2
        reflog, ret = repo._git_getoutput('reflog')
        ok_("gbp: Import Debian changes" in reflog[1])
        ok_("gbp: Import Upstream version 2.6" in reflog[2])
        self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
        dsc = _dsc('2.8-1')
        assert import_dsc(['arg0',
                           '--verbose',
                           '--pristine-tar',
                           '--debian-branch=foo',
                           '--upstream-branch=bar',
                           '--create-missing-branches',
                           dsc]) == 0
        self._check_repo_state(repo, 'master', ['bar', 'foo', 'master', 'pristine-tar', 'upstream'])
        commits, expected = len(repo.get_commits()), 2
        ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: test_bare

# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import _git_getoutput [as 别名]
    def test_bare(self):
        """Test if importing into bare repository"""
        def _dsc(version):
            return os.path.join(DEB_TEST_DATA_DIR,
                                'dsc-3.0',
                                'hello-debhelper_%s.dsc' % version)

        dsc = _dsc('2.6-2')
        assert import_dsc(['arg0',
                           '--verbose',
                           '--pristine-tar',
                           '--debian-branch=master',
                           '--upstream-branch=upstream',
                           dsc]) == 0
        repo = ComponentTestGitRepository('hello-debhelper')
        os.chdir('hello-debhelper')
        assert len(repo.get_commits()) == 2
        reflog, ret = repo._git_getoutput('reflog')
        ok_("gbp: Import Debian changes" in reflog[1])
        ok_("gbp: Import Upstream version 2.6" in reflog[2])
        self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream'])
        commitmsg = repo.get_commit_info('HEAD')['body']
        ok_("hello-debhelper (2.6-2) unstable; urgency=medium" in commitmsg)
        ok_("hello (1.3-7) experimental; urgency=LOW" in commitmsg)

        dsc = _dsc('2.8-1')
        assert import_dsc(['arg0',
                           '--verbose',
                           '--pristine-tar',
                           '--debian-branch=master',
                           '--upstream-branch=upstream',
                           dsc]) == 0
        commits, expected = len(repo.get_commits()), 4
        ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected))
        commitmsg = repo.get_commit_info('HEAD')['body']
        ok_("hello-debhelper (2.8-1) unstable; urgency=low" in commitmsg)
        ok_("ello-debhelper (2.7-1) unstable; urgency=low" in commitmsg)
        ok_("hello-debhelper (2.6-2) unstable; urgency=medium" not in commitmsg)
开发者ID:,项目名称:,代码行数:40,代码来源:


注:本文中的tests.component.ComponentTestGitRepository._git_getoutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。