From fc953ee505efc8a1af5519abc1c7d9df3812ecf5 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Fri, 3 Aug 2018 19:17:47 +0200 Subject: [PATCH] Fix item being ignored in get_info This, I think, would've caused get_all_jobs to loop indefinitely if the Jenkins instance has folders. Am I really the first to have caught this? Change-Id: I4158b0d068135de08a3337486d8a4b41d8b7cda6 --- jenkins/__init__.py | 2 +- tests/jobs/test_get.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/__init__.py b/jenkins/__init__.py index 4216fa4..da15b12 100755 --- a/jenkins/__init__.py +++ b/jenkins/__init__.py @@ -770,7 +770,7 @@ class Jenkins(object): url += query try: return json.loads(self.jenkins_open( - requests.Request('GET', self._build_url(INFO)) + requests.Request('GET', self._build_url(url)) )) except (req_exc.HTTPError, BadStatusLine): raise BadHTTPException("Error communicating with server[%s]" diff --git a/tests/jobs/test_get.py b/tests/jobs/test_get.py index 3f967fe..cb0cc72 100644 --- a/tests/jobs/test_get.py +++ b/tests/jobs/test_get.py @@ -25,7 +25,7 @@ class JenkinsGetJobsTest(JenkinsGetJobsTestBase): self.assertEqual(job_info, [jobs]) self.assertEqual( jenkins_mock.call_args[0][0].url, - self.make_url('api/json')) + self.make_url('api/json?tree=jobs[url,color,name,jobs]')) self._check_requests(jenkins_mock.call_args_list) @patch.object(jenkins.Jenkins, 'jenkins_open')