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


Python TravisPy.jobs方法代碼示例

本文整理匯總了Python中travispy.TravisPy.jobs方法的典型用法代碼示例。如果您正苦於以下問題:Python TravisPy.jobs方法的具體用法?Python TravisPy.jobs怎麽用?Python TravisPy.jobs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在travispy.TravisPy的用法示例。


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

示例1: setup_method

# 需要導入模塊: from travispy import TravisPy [as 別名]
# 或者: from travispy.TravisPy import jobs [as 別名]

#.........這裏部分代碼省略.........
        # FIXME: This line is actually outside the timed command
        assert block.elements[0].lines[1] == '\x1b[0K\x1b[33;1m7 is not pre-installed; installing\x1b[0m'
        assert command.exit_code is None

        command = block.elements[1]
        assert isinstance(command, TimedCommand)
        assert command.identifier == '13246fda'
        assert len(command.lines) == 0
        command = block.elements[2]
        assert isinstance(command, TimedCommand)
        assert command.identifier == '0fbbeb8d'
        assert len(command.lines) == 0
        command = block.elements[3]
        assert isinstance(command, TimedCommand)
        assert command.identifier == '0002a78c'
        assert len(command.lines) == 0

        command = block.elements[4]
        assert isinstance(command, TimedCommand)
        assert command.identifier == '26c935df'
        assert len(command.lines) == 1
        assert command.executed == 'phpenv global 7'

        assert block_names[6] == '_versions'
        assert '_versions' in blocks
        block = blocks['_versions']

        assert isinstance(block, AutoVersionCommandBlock)
        assert len(block.elements) == 2

        assert isinstance(block.elements[0], Command)
        assert len(block.elements[0].lines) == 5
        assert block.elements[0].executed == 'php --version'
        assert block.elements[0].lines[1] == 'PHP 7.0.0-dev (cli) (built: Sep 28 2015 22:41:46) '
        assert block.elements[0].exit_code is None

        assert isinstance(block.elements[1], Command)
        assert len(block.elements[1].lines) == 3
        assert block.elements[1].executed == 'composer --version'
        assert block.elements[1].lines[1] == '\x1b[32mComposer\x1b[39m version \x1b[33m1.0-dev (c41079192f38f0fc446b17baa8f628dcb3b61e7d)\x1b[39m 2015-09-28 09:38:16'
        assert block.elements[1].lines[2] == '\x1b[0m'

    def test_ios(self):
        log = self._get_job_log('wikimedia/wikipedia-ios/543.1', job_id=82596055)
        assert log.body != ''

        blocks = self._parse(log)
        return
        block_names = list(name for name in blocks.keys() if not name.startswith('_unexpected_blank_lines'))

        assert block_names == [
            '_worker', 'system_info', 'git.checkout', 'git.submodule',
            'rvm', '_versions-odd', 'announce', '_versions-extra',
            'install', 'script', 'after_success', '_done',
        ]

    def test_ruby(self):
        log = self._get_job_log('smalruby/smalruby/193.1', job_id=68760112)
        assert log.body != ''

        blocks = self._parse(log)
        return
        block_names = list(name for name in blocks.keys() if not name.startswith('_unexpected_blank_lines'))

        assert block_names == [
            '_worker', 'system_info', 'git.checkout',
            '_travis_yml_environment_variables', 'rvm', '_versions',
            'before_install', 'install.bundler', 'script', '_done',
        ]

    def test_cpp(self):
        log = self._get_job_log('cocos2d/cocos2d-x/7635.1', job_id=22148153)
        assert log.body != ''

        blocks = self._parse(log)
        return
        block_names = list(name for name in blocks.keys() if not name.startswith('_unexpected_blank_lines'))

        # FIXME: _versions doesnt get separated
        assert block_names == [
            '_worker', '_top_env', 'git',
            'before_install', 'script', '_done',
        ]

    def test_foo(self):
        log = self._get_job_log('datamade/dedupe/556.2', job_id=17375120)
        assert log.body != ''

        blocks = self._parse(log)
        return

    def test_random_passed(self):
        """Test a recently finished job."""
        jobs = self._travis.jobs(state='passed')
        job_id = jobs[0].id
        print('Random using job_id {0}'.format(job_id))
        log = self._get_job_log(job_id=job_id)

        assert log.body != ''
        blocks = self._parse(log)
開發者ID:jayvdb,項目名稱:travis_log_parser_wip,代碼行數:104,代碼來源:test_parse_log.py


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