當前位置: 首頁>>代碼示例>>Python>>正文


Python FedoraReview.Settings類代碼示例

本文整理匯總了Python中FedoraReview.Settings的典型用法代碼示例。如果您正苦於以下問題:Python Settings類的具體用法?Python Settings怎麽用?Python Settings使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Settings類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_sha384

 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,代碼行數:7,代碼來源:test_misc.py

示例2: test_sha256

 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,代碼行數:7,代碼來源:test_misc.py

示例3: test_sha512

 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,代碼行數:7,代碼來源:test_misc.py

示例4: test_sha224

 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,代碼行數:7,代碼來源:test_misc.py

示例5: init_test

    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,代碼行數:32,代碼來源:fr_testcase.py

示例6: test_md5

 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,代碼行數:7,代碼來源:test_misc.py

示例7: test_sha1

 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,代碼行數:7,代碼來源:test_misc.py

示例8: test_checksum_command_line

 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,代碼行數:7,代碼來源:test_misc.py

示例9: test_prebuilt

    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,代碼行數:26,代碼來源:test_options.py

示例10: test_checksum_command_line

 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,代碼行數:7,代碼來源:test_misc.py

示例11: init_test

 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,代碼行數:28,代碼來源:fr_testcase.py

示例12: setUp

 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,代碼行數:7,代碼來源:test_R_checks.py

示例13: init_test

 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,代碼行數:10,代碼來源:test_options.py

示例14: test_desktop_file_bug

 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,代碼行數:11,代碼來源:test_misc.py

示例15: setUp

 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,代碼行數:11,代碼來源:test_regressions.py


注:本文中的FedoraReview.Settings類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。