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


Python Settings.init方法代码示例

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


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

示例1: test_sha384

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_sha384(self):
     sys.argv = ['fedora-review','-b','1']
     Settings.init(True)
     Settings.checksum = 'sha384'
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '3d6a580100b1e8a40dc41892f6b289ff13c0b489b8079d8b7c01a17c67b88bf77283f784b4e8dacac6572050df8c948e')
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例2: test_sha256

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_sha256(self):
     sys.argv = ['fedora-review','-b','1']
     Settings.init(True)
     Settings.checksum = 'sha256'
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, 'd8669d49c8557ac47681f9b85e322849fa84186a8683c93959a590d6e7b9ae29')
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例3: test_sha512

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_sha512(self):
     sys.argv = ['fedora-review','-b','1']
     Settings.init(True)
     Settings.checksum = 'sha512'
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '77a138fbd918610d55d9fd22868901bd189d987f17701498164badea88dd6f5612c118fc9e66d7b57f802bf0cddadc1cec54674ee1c3df2ddfaf1cac4007ac26')
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例4: test_sha224

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_sha224(self):
     sys.argv = ['fedora-review','-b','1']
     Settings.init(True)
     Settings.checksum = 'sha224'
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '01959559db8ef8d596ff824fe207fc0345be67df6b8a51942214adb7')
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例5: init_test

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
    def init_test(self, cd, argv=None, wd=None,
                  buildroot=None, options=None):
        '''
        Initiate a test which runs in directory cd
        kwargs:
           argv: fed to sys.argv and eventually to Settings
                 fedora-review is prepended and mock_root appended.
           wd:   review directory, cleared.
           options: mock-options'''

        cd = os.path.abspath(cd)
        os.chdir(cd)
        if not wd:
            wd = os.getcwd()
        ReviewDirs.workdir_setup(wd, 'testing')
        if not argv:
            argv = []
        args = argv
        args.insert(0, 'fedora-review')
        br = buildroot if buildroot else self.BUILDROOT
        args.append("--mock-config=" + br)
        opts = []
        if NO_NET:
            opts.append('--offline')
        if options:
            opts.append(options)
        if opts:
            argv.append('--mock-options=' + ' '.join(opts))
        sys.argv = argv
        Settings.init(True)
        Mock.clear_builddir()
        Mock.reset()
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:34,代码来源:fr_testcase.py

示例6: test_md5

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_md5(self):
     sys.argv = ['fedora-review','-b','1']
     Settings.init(True)
     Settings.checksum = 'md5'
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '4a1c937e62192753c550221876613f86')
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例7: test_sha1

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_sha1(self):
     sys.argv = ['fedora-review','-b','1']
     Settings.init(True)
     Settings.checksum = 'sha1'
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '5315b33321883c15c19445871cd335f7f698a2aa')
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例8: test_checksum_command_line

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_checksum_command_line(self):
     sys.argv = ['fedora-review','-n','python-test','--prebuilt',
                 '-k','sha1']
     Settings.init(True)
     helpers = Helpers()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '5315b33321883c15c19445871cd335f7f698a2aa')
开发者ID:hadrons123,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例9: test_prebuilt

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
    def test_prebuilt(self):
        """ test --name --prebuilt """

        argv = ["fedora-review", "-rpn", "python-spiffgtkwidgets"]
        argv.extend(["--mock-config", "fedora-16-i386"])
        sys.argv = argv
        os.chdir("prebuilt")
        if os.path.exists("python-spiffgtkwidgets"):
            shutil.rmtree("python-spiffgtkwidgets")
        ReviewDirs.reset()
        Settings.init(True)

        rpms = glob("/var/lib/mock/fedora-16-i386/*.rpm")
        for r in rpms:
            os.unlink(r)

        rh = ReviewHelper()
        sys.stdout = open("/dev/null", "w")
        rh.run()
        sys.stdout = sys.__stdout__
        self.assertEqual(len(rpms), 0)
        rv = "python-spiffgtkwidgets-review.txt"
        with open(os.path.abspath(rv)) as f:
            log = "\n".join(f.readlines())
        self.assertIn("Using prebuilt rpms", log)
        os.chdir(startdir)
开发者ID:ralphbean,项目名称:FedoraReview,代码行数:28,代码来源:test_options.py

示例10: test_checksum_command_line

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_checksum_command_line(self):
     ''' Default checksum test. '''
     sys.argv = ['fedora-review', '-b', '1', '-k', 'sha1']
     Settings.init(True)
     helpers = HelpersMixin()
     checksum = helpers._checksum('scantailor.desktop')
     self.assertEqual(checksum, '5315b33321883c15c19445871cd335f7f698a2aa')
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:9,代码来源:test_misc.py

示例11: init_test

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def init_test(self, cd, argv=[], wd=None,
               buildroot=None, options=None):
     # Initiate a test which runs in directory cd
     # kwargs:
     #    argv: fed to sys.argv and eventually to Settings
     #          fedora-review is prepended and mock_root appended.
     #    wd:   review directory, cleared.
     #    options: mock-options
     os.chdir(cd)
     if wd:
         if os.path.exists(wd):
             shutil.rmtree(wd)
     ReviewDirs.reset(cd)
     ReviewDirs.workdir_setup(os.getcwd(), True)
     args = argv
     args.insert(0, 'fedora-review')
     br = buildroot if buildroot else self.BUILDROOT
     args.append("--mock-config=" + br)
     opts = []
     if NO_NET:
         opts.append('--offline')
     if options:
         opts.append(options)
     if opts:
         argv.append('--mock-options=' +  ' '.join(opts))
     sys.argv = argv
     Settings.init(True)
     Mock.reset()
开发者ID:pombredanne,项目名称:FedoraReview,代码行数:30,代码来源:fr_testcase.py

示例12: setUp

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def setUp(self):
     sys.argv = ['fedora-review','-rpn','R-Rdummypkg']
     os.chdir('test-R')
     if os.path.exists('R-Rdummypkg'):
          shutil.rmtree('R-Rdummypkg')
     Settings.init(True)
     ReviewDirs.reset()
开发者ID:hadrons123,项目名称:FedoraReview,代码行数:9,代码来源:test_R_checks.py

示例13: init_test

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def init_test(self, argv=["fedora-review"], d=None):
     os.chdir(startdir)
     if d:
         os.chdir(d)
     if os.path.exists("python-test"):
         shutil.rmtree("python-test")
     ReviewDirs.reset()
     ReviewDirs.workdir_setup(".", True)
     sys.argv = argv
     Settings.init(True)
开发者ID:ralphbean,项目名称:FedoraReview,代码行数:12,代码来源:test_options.py

示例14: test_desktop_file_bug

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def test_desktop_file_bug(self):
     os.chdir('desktop-file')
     if os.path.exists('python-test'):
         shutil.rmtree('python-test')
     sys.argv = ['fedora-review','-rpn','python-test']
     Settings.init(True)
     ReviewDirs.reset()
     bug = NameBug('python-test')
     check = self.run_single_check(bug,'CheckDesktopFileInstall')
     self.assertEqual(check.state, 'pass')
     os.chdir(self.startdir)
开发者ID:hadrons123,项目名称:FedoraReview,代码行数:13,代码来源:test_misc.py

示例15: setUp

# 需要导入模块: from FedoraReview import Settings [as 别名]
# 或者: from FedoraReview.Settings import init [as 别名]
 def setUp(self):
     FR_TestCase.setUp(self)
     sys.argv = ['fedora-review', '-b', '1']
     Settings.init(True)
     self.spec_file = os.path.join(os.path.abspath('.'),
                                   'test_regressions',
                                   'test_107_1.spec')
     self.srpm_file = os.path.join(os.path.abspath('.'),
                                   'test_regressions',
                                   'test_107_1-1.0-1.fc17.src.rpm')
     Mock.reset()
开发者ID:athos-ribeiro,项目名称:FedoraReview,代码行数:13,代码来源:test_regressions.py


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