Remove unused builder.Builder.update_job method
The deprecation warning message in this method was confusing and seemed to be intended for builder.Jenkins.update_job but it's hard to tell for sure. Seems likely to be an artifact of an outdated patchset in the parallelize-the-things work done last year because it's not clear how it could apply to builder.Builder.update_jobs which has a significantly different use case than parallel_update_job. Change-Id: Ifb3c1a40d81b0d43ac8e85151f0a99d1502e21db
This commit is contained in:
parent
8ffb11a4bf
commit
1fe7709923
@ -371,9 +371,3 @@ class Builder(object):
|
||||
def parallel_update_job(self, job):
|
||||
self.jenkins.update_job(job.name, job.output().decode('utf-8'))
|
||||
return (job.name, job.md5())
|
||||
|
||||
def update_job(self, input_fn, jobs_glob=None, output=None):
|
||||
logging.warn('Current update_job function signature is deprecated and '
|
||||
'will change in future versions to the signature of the '
|
||||
'new parallel_update_job')
|
||||
return self.update_jobs(input_fn, jobs_glob, output)
|
||||
|
@ -122,13 +122,7 @@ class UpdateTests(CmdTestsBase):
|
||||
path = os.path.join(self.fixtures_path, 'cmd-002.yaml')
|
||||
args = ['--conf', self.default_config_file, 'update', path]
|
||||
|
||||
import_path = 'jenkins_jobs.cli.subcommand.update.Builder.update_job'
|
||||
with mock.patch(import_path) as update_mock:
|
||||
update_mock.return_value = ([], 0)
|
||||
self.execute_jenkins_jobs_with_args(args)
|
||||
# unless the timeout is set, should only call with 3 arguments
|
||||
# (url, user, password)
|
||||
self.assertEqual(len(jenkins_mock.call_args[0]), 3)
|
||||
self.execute_jenkins_jobs_with_args(args)
|
||||
|
||||
@mock.patch('jenkins_jobs.builder.jenkins.Jenkins')
|
||||
def test_update_timeout_set(self, jenkins_mock):
|
||||
@ -143,10 +137,11 @@ class UpdateTests(CmdTestsBase):
|
||||
'non-default-timeout.ini')
|
||||
args = ['--conf', config_file, 'update', path]
|
||||
|
||||
import_path = 'jenkins_jobs.cli.subcommand.update.Builder.update_job'
|
||||
with mock.patch(import_path) as update_mock:
|
||||
update_mock.return_value = ([], 0)
|
||||
self.execute_jenkins_jobs_with_args(args)
|
||||
# when timeout is set, the fourth argument to the Jenkins api init
|
||||
# should be the value specified from the config
|
||||
self.assertEqual(jenkins_mock.call_args[0][3], 0.2)
|
||||
self.execute_jenkins_jobs_with_args(args)
|
||||
|
||||
# when timeout is set, the fourth argument to builder.Jenkins should be
|
||||
# the value specified from the config
|
||||
jenkins_mock.assert_called_with(mock.ANY,
|
||||
mock.ANY,
|
||||
mock.ANY,
|
||||
0.2)
|
||||
|
Loading…
Reference in New Issue
Block a user