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


Python Job._add_missing_builds方法代码示例

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


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

示例1: test_empty_field__add_missing_builds

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _add_missing_builds [as 别名]
 def test_empty_field__add_missing_builds(self, get_data):
     url = "http://halob:8080/job/foo/%s" % config.JENKINS_API
     data = TestJob.URL_DATA[url].copy()
     data.update({"firstBuild": None})
     get_data.return_value = data
     j = Job("http://halob:8080/job/foo/", "foo", self.J)
     initial_call_count = get_data.call_count
     j._add_missing_builds(data)
     self.assertEquals(get_data.call_count, initial_call_count)
开发者ID:henriklynggaard,项目名称:jenkinsapi,代码行数:11,代码来源:test_job.py

示例2: test__add_missing_builds_no_builds

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _add_missing_builds [as 别名]
 def test__add_missing_builds_no_builds(self, get_data):
     url = 'http://halob:8080/job/foo/%s' % config.JENKINS_API
     data = TestJob.URL_DATA[url].copy()
     get_data.return_value = data
     j = Job('http://halob:8080/job/foo/', 'foo', self.J)
     initial_call_count = get_data.call_count
     mock_data = TestJob.URL_DATA[url].copy()
     mock_data['builds'] = None
     j._add_missing_builds(mock_data)
     self.assertEquals(initial_call_count, get_data.call_count)
开发者ID:Khan,项目名称:jenkinsapi,代码行数:12,代码来源:test_job.py

示例3: test__add_missing_builds_no_first_build

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _add_missing_builds [as 别名]
 def test__add_missing_builds_no_first_build(self, get_data):
     url = "http://halob:8080/job/foo/%s" % config.JENKINS_API
     data = TestJob.URL_DATA[url].copy()
     get_data.return_value = data
     j = Job("http://halob:8080/job/foo/", "foo", self.J)
     initial_call_count = get_data.call_count
     mock_data = TestJob.URL_DATA[url].copy()
     mock_data["firstBuild"] = None
     j._add_missing_builds(mock_data)
     self.assertEquals(initial_call_count, get_data.call_count)
开发者ID:baijum,项目名称:jenkinsapi,代码行数:12,代码来源:test_job.py

示例4: test__add_missing_builds_not_all_loaded

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _add_missing_builds [as 别名]
 def test__add_missing_builds_not_all_loaded(self, get_data):
     url = 'http://halob:8080/job/foo/%s' % config.JENKINS_API
     data = TestJob.URL_DATA[url].copy()
     get_data.return_value = data
     j = Job('http://halob:8080/job/foo/', 'foo', self.J)
     # 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 = TestJob.URL_DATA[url].copy()
     mock_data['firstBuild'] = {'number': 1}
     del mock_data['builds'][-1]
     self.assertEquals(len(mock_data['builds']), 2)
     new_data = j._add_missing_builds(mock_data)
     self.assertEquals(len(new_data['builds']), 3)
开发者ID:Khan,项目名称:jenkinsapi,代码行数:18,代码来源:test_job.py

示例5: test__add_missing_builds_not_all_loaded

# 需要导入模块: from jenkinsapi.job import Job [as 别名]
# 或者: from jenkinsapi.job.Job import _add_missing_builds [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._add_missing_builds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。