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


Python NameBug.download_files方法代码示例

本文整理汇总了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')
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:30,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:11,代码来源:test_options.py

示例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'])
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:12,代码来源:test_misc.py

示例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')
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:12,代码来源:test_options.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:14,代码来源:test_misc.py

示例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')
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:14,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:14,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:14,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:15,代码来源:test_ext.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:16,代码来源:test_options.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:17,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:17,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:17,代码来源:test_misc.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:18,代码来源:test_options.py

示例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)
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:18,代码来源:test_options.py


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