本文整理汇总了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)
示例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)
示例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)
示例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)
示例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