From: Aleksey Maksimov Date: Sat, 12 Apr 2014 15:54:07 +0000 (+0800) Subject: Added support for 'del' in Jenkins object: remove job X-Git-Tag: v0.2.23~24^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6f897fc0810b44497b11bfb6600127bd140eb27;p=tools%2Fpython-jenkinsapi.git Added support for 'del' in Jenkins object: remove job --- diff --git a/jenkinsapi/jenkins.py b/jenkinsapi/jenkins.py index 9abf2a9..86e858e 100644 --- a/jenkinsapi/jenkins.py +++ b/jenkinsapi/jenkins.py @@ -235,6 +235,9 @@ class Jenkins(JenkinsBase): """ return jobname in self.jobs + def __delitem__(self, job_name): + del self.jobs[job_name] + def get_node(self, nodename): """Get a node object for a specific node""" return self.get_nodes()[nodename] diff --git a/jenkinsapi_tests/systests/base.py b/jenkinsapi_tests/systests/base.py index 758ec86..a87caed 100644 --- a/jenkinsapi_tests/systests/base.py +++ b/jenkinsapi_tests/systests/base.py @@ -17,8 +17,8 @@ class BaseSystemTest(unittest.TestCase): def _delete_all_jobs(self): self.jenkins.poll() - for name in self.jenkins.get_jobs_list(): - self.jenkins.delete_job(name) + for name in self.jenkins.keys(): + del self.jenkins[name] def _delete_all_views(self): all_view_names = self.jenkins.views.keys()[1:]