本文整理汇总了Python中FedoraReview.name_bug.NameBug.download_files方法的典型用法代码示例。如果您正苦于以下问题:Python NameBug.download_files方法的具体用法?Python NameBug.download_files怎么用?Python NameBug.download_files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FedoraReview.name_bug.NameBug
的用法示例。
在下文中一共展示了NameBug.download_files方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dirty_resultdir
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_dirty_resultdir(self):
''' Test that non-empty resultdir quits. '''
self.init_test('test_misc',
argv=['-n', 'python-test', '--cache'])
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file).get_checks()
checks.set_single_check('CheckResultdir')
check = checks['CheckResultdir']
if not os.path.exists('results.bak'):
os.makedirs('results.bak')
for dirt in glob.glob('results/*.*'):
shutil.move(dirt, 'results.bak')
check.run()
self.assertTrue(check.is_na)
try:
subprocess.check_call('touch results/orvar.rpm', shell=True)
except OSError:
pass
self.assertRaises(ReviewError, check.run)
Settings.nobuild = True
check.run()
self.assertTrue(check.is_na)
os.unlink('results/orvar.rpm')
for dirt in glob.glob('results.bak/*'):
shutil.move(dirt, 'results')
示例2: test_exclude
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_exclude(self):
''' test --exclude/-x option. '''
self.init_opt_test(['-n', 'python-test', '-x', 'CheckRequires',
'--cache'])
bug = NameBug(Settings.name)
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
self.assertTrue(checks.checkdict['CheckRequires'].result is None)
示例3: test_flags_2
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_flags_2(self):
''' Flag defined in python, not set by user' '''
self.init_test('test_misc',
argv=['-n', 'python-test', '--cache',
'--no-build'])
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
self.assertFalse(checks.flags['EPEL5'])
示例4: test_single
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_single(self):
''' test --single/-s option '''
self.init_opt_test(['-n', 'python-test', '-s', 'CheckRequires',
'--cache'])
bug = NameBug(Settings.name)
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
check = checks.checkdict['CheckRequires']
self.assertEqual(check.name, 'CheckRequires')
示例5: test_prebuilt_sources
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_prebuilt_sources(self):
''' Local built RPM:s (-n) test. '''
self.init_test('test_misc',
argv=['-cn', 'python-test', '--prebuilt'])
ReviewDirs.startdir = os.getcwd()
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
subprocess.check_call('touch orvar.rpm', shell=True)
rpms = Mock.get_package_rpm_paths(checks.spec)
self.assertEqual(len(rpms), 1)
示例6: test_flags_4
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_flags_4(self):
''' Flag defined in shell script , set by user to value '''
os.environ['XDG_DATA_HOME'] = os.getcwd()
self.init_test('test_misc',
argv=['-n', 'python-test', '--cache',
'--no-build', '-D', 'EPEL6=foo'])
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
self.assertEqual(str(checks.flags['EPEL6']), 'foo')
示例7: test_local_repo
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_local_repo(self):
''' Local repo with prebuilt rpms test. '''
self.init_test('test_misc',
argv=['-rn', 'python-test', '--local-repo',
'repo', '--cache'])
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
check = checks.checkdict['CheckPackageInstalls']
check.run()
self.assertTrue(check.is_passed)
示例8: test_flags_3
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_flags_3(self):
''' Flag not defined , set by user' '''
self.init_test('test_misc',
argv=['-n', 'python-test', '--cache',
'--no-build', '-D', 'EPEL8'])
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
with self.assertRaises(ReviewError):
# pylint: disable=W0612
checks = Checks(bug.spec_file, bug.srpm_file)
示例9: test_sh_api
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_sh_api(self):
''' Basic shell API test. '''
self.init_test('test_ext',
argv=['-pn', 'python-test', '--cache',
'--no-build'],
wd='review-python-test')
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
checks.checkdict['CreateEnvCheck'].run()
checks.checkdict['unittest-test2'].run()
self.assertTrue(checks.checkdict['unittest-test2'].is_pending)
示例10: test_prebuilt
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_prebuilt(self):
''' test --name --prebuilt '''
argv = ['-rpn', 'python-spiffgtkwidgets', '--cache']
self.init_test('prebuilt', argv=argv)
bug = NameBug('python-spiffgtkwidgets')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
check = checks.checkdict['CheckBuild']
check.run()
self.assertTrue(check.is_pending)
self.assertIn('Using prebuilt packages',
check.result.output_extra)
示例11: test_bad_specname
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_bad_specname(self):
''' Specfile with bad name test. '''
loglevel = os.environ['REVIEW_LOGLEVEL']
os.environ['REVIEW_LOGLEVEL'] = 'ERROR'
self.init_test('bad-specname',
argv=['-rn', 'python-test', '--cache'])
os.environ['REVIEW_LOGLEVEL'] = loglevel
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
check = checks.checkdict['CheckSpecAsInSRPM']
check.run()
self.assertTrue(check.is_failed)
self.assertIn('Bad spec filename:', check.result.output_extra)
示例12: test_perl_module
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_perl_module(self):
''' test basic perl python + shell test '''
self.init_test('perl',
argv=['-rpn', 'perl-RPM-Specfile', '--no-build'])
bug = NameBug('perl-RPM-Specfile')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file)
checks.checkdict['CreateEnvCheck'].run()
check = checks.checkdict['PerlCheckBuildRequires']
check.run()
self.assertTrue(check.is_pending)
check = checks.checkdict['perl-url-tag']
check.run()
self.assertTrue(check.is_pending)
示例13: test_md5sum_diff_ok
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_md5sum_diff_ok(self):
''' Complete MD5sum test expected to pass. '''
self.init_test('md5sum-diff-ok',
argv=['-rpn', 'python-test', '--cache',
'--no-build'])
bug = NameBug('python-test')
bug.find_urls()
bug.download_files()
checks = Checks(bug.spec_file, bug.srpm_file).get_checks()
checks.set_single_check('CheckSourceMD5')
check = checks['CheckSourceMD5']
check.run()
self.assertTrue(check.is_passed)
expected = 'diff -r shows no differences'
self.assertTrue(expected in check.result.attachments[0].text)
示例14: test_name
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_name(self):
""" Test -name option """
self.init_opt_test(['-n', 'python-test', '--cache'])
bug = NameBug(Settings.name)
bug.find_urls()
expected = self.abs_file_url('./python-test-1.0-1.fc17.src.rpm')
self.assertEqual(expected, bug.srpm_url)
expected = self.abs_file_url('./python-test.spec')
self.assertEqual(expected, bug.spec_url)
bug.download_files()
expected = os.path.abspath('./python-test-1.0-1.fc17.src.rpm')
self.assertEqual(expected, bug.srpm_file)
expected = os.path.abspath('./python-test.spec')
self.assertEqual(expected, bug.spec_file)
示例15: test_rpm_spec
# 需要导入模块: from FedoraReview.name_bug import NameBug [as 别名]
# 或者: from FedoraReview.name_bug.NameBug import download_files [as 别名]
def test_rpm_spec(self):
""" Test --rpm-spec/-r option """
self.init_opt_test(['-rn', 'python-test', '--cache'], 'options')
bug = NameBug(Settings.name)
bug.find_urls()
expected = self.abs_file_url('python-test-1.0-1.fc17.src.rpm')
self.assertEqual(expected, bug.srpm_url)
expected = self.abs_file_url('srpm-unpacked/python-test.spec')
self.assertEqual(expected, bug.spec_url)
bug.download_files()
expected = os.path.abspath('python-test-1.0-1.fc17.src.rpm')
self.assertEqual(expected, bug.srpm_file)
expected = os.path.abspath('srpm-unpacked/python-test.spec')
self.assertEqual(expected, bug.spec_file)