本文整理汇总了Python中tests.component.ComponentTestGitRepository.has_branch方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentTestGitRepository.has_branch方法的具体用法?Python ComponentTestGitRepository.has_branch怎么用?Python ComponentTestGitRepository.has_branch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.component.ComponentTestGitRepository
的用法示例。
在下文中一共展示了ComponentTestGitRepository.has_branch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_git_archive_tree_non_existent
# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import has_branch [as 别名]
def test_git_archive_tree_non_existent(self):
"""Test that we're failing tarball generation when commits are missing"""
pkg = 'hello-debhelper'
dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
repo = ComponentTestGitRepository(pkg)
os.chdir(pkg)
assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch not must exist")
ret = export_orig(['arg0',
'--component=bar', # non-existing component
'--no-pristine-tar'])
ok_(ret == 1, "Exporting tarballs must fail")
self._check_log(-1, "gbp:error: No tree for 'bar' found in "
"'upstream/2.8' to create additional tarball from")
示例2: test_pristine_tar_commit_non_existent
# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import has_branch [as 别名]
def test_pristine_tar_commit_non_existent(self):
"""Test that we're failing if pristine-tar commit is missing"""
pkg = 'hello-debhelper'
dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
repo = ComponentTestGitRepository(pkg)
os.chdir(pkg)
assert_true(repo.has_branch('pristine-tar'), "Pristine-tar branch must exist")
repo.delete_branch("pristine-tar")
repo.create_branch("pristine-tar") # create a nonsense pristine-tar branch
ret = export_orig(['arg0',
'--component=foo',
'--pristine-tar'])
ok_(ret == 1, "Exporting tarballs must fail")
self._check_log(-1, ".*git show refs/heads/pristine-tar:.*failed")
示例3: test_component_generation
# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import has_branch [as 别名]
def test_component_generation(self):
"""Test that generating tarball and additional tarball works without pristine-tar"""
pkg = 'hello-debhelper'
dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
"../%s_2.8.orig.tar.gz" % pkg]
assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
repo = ComponentTestGitRepository(pkg)
os.chdir(pkg)
assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch must not exist")
for t in tarballs:
self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
ret = export_orig(['arg0',
'--component=foo',
'--no-pristine-tar'])
ok_(ret == 0, "Exporting tarballs failed")
for t in tarballs:
self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
示例4: test_pristinetar_component_generation
# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import has_branch [as 别名]
def test_pristinetar_component_generation(self):
"""Test that generating tarball and additional tarball works with pristine-tar"""
pkg = 'hello-debhelper'
dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
"../%s_2.8.orig.tar.gz" % pkg]
assert import_dsc(['arg0', '--pristine-tar', dsc]) == 0
repo = ComponentTestGitRepository(pkg)
os.chdir(pkg)
assert_true(repo.has_branch('pristine-tar'), "Pristine-tar branch must exist")
for t in tarballs:
self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
# Make sure the tree object for importing the main tarball is recreated
repo.collect_garbage(prune='all', aggressive=True)
ret = export_orig(['arg0',
'--component=foo',
'--pristine-tar'])
ok_(ret == 0, "Exporting tarballs failed")
for t in tarballs:
self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
示例5: test_component_generation
# 需要导入模块: from tests.component import ComponentTestGitRepository [as 别名]
# 或者: from tests.component.ComponentTestGitRepository import has_branch [as 别名]
def test_component_generation(self):
"""Test that generating tarball and additional tarball works without pristine-tar"""
pkg = 'hello-debhelper'
dsc = self._dsc_name(pkg, '2.8-1', 'dsc-3.0-additional-tarballs')
tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
"../%s_2.8.orig.tar.gz" % pkg]
assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
repo = ComponentTestGitRepository(pkg)
os.chdir(pkg)
assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch must not exist")
for t in tarballs:
self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
ret = buildpackage(['arg0',
'--git-component=foo',
'--git-no-pristine-tar',
'--git-posttag=printenv > posttag.out',
'--git-builder=touch builder-run.stamp',
'--git-cleaner=/bin/true'])
ok_(ret == 0, "Building the package failed")
for t in tarballs:
self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)