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


Python Job._data方法代码示例

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


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

示例1: aget_job

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _data [as 别名]
    def aget_job(self, name):
        self.load()
        url = self.rest.job(name)
        try:
            data = yield from url.api.python.aget()
        except aiohttp.errors.HttpProcessingError as e:
            if 404 == e.code:
                raise UnknownJob()
            raise

        instance = JenkinsJob(data['url'], data['name'], self._instance)
        instance._data = data
        payload = yield from url('config.xml').aget()
        instance._config = payload.data
        return Job.factory(instance)
开发者ID:novafloss,项目名称:jenkins-github-poller,代码行数:17,代码来源:jenkins.py

示例2: test__add_missing_builds_not_all_loaded

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _data [as 别名]
def test__add_missing_builds_not_all_loaded(jenkins, monkeypatch):
    def fake_get_data(cls, url, tree):  # pylint: disable=unused-argument
        return configs.JOB_DATA.copy()

    monkeypatch.setattr(JenkinsBase, 'get_data', fake_get_data)
    job = Job('http://halob:8080/job/foo/', 'foo', jenkins)

    # to test this function we change data to not have one build
    # and set it to mark that firstBuild was not loaded
    # in that condition function will call j.get_data
    # and will use syntetic field 'allBuilds' to
    # repopulate 'builds' field with all builds
    mock_data = configs.JOB_DATA.copy()
    mock_data['firstBuild'] = {'number': 1}
    del mock_data['builds'][-1]
    job._data = mock_data

    assert len(mock_data['builds']) == 2
    new_data = job._add_missing_builds(mock_data)
    assert len(new_data['builds']) == 3
开发者ID:PaleoWoods,项目名称:jenkinsapi,代码行数:22,代码来源:test_job.py


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