summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-25 18:17:38 +0000
committerGerrit Code Review <review@openstack.org>2019-01-25 18:17:38 +0000
commit76ac47442f5fa895f533b9d6c3fc39597d1ef700 (patch)
treeb6ae1d608e5920c8dc693529364602c98a30b463
parent492e41fefd521ef5115fb079c4df00bf9fbc74b0 (diff)
parent47452f9130a8fe7757290cf858333063cf331dec (diff)
Merge "Fix noop job toDict()"
-rwxr-xr-xtests/unit/test_web.py4
-rw-r--r--zuul/model.py5
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index 5f18a75..05701a6 100755
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -572,6 +572,10 @@ class TestWeb(BaseTestWeb):
572 resp = self.get_url("api/tenant/non-tenant/jobs") 572 resp = self.get_url("api/tenant/non-tenant/jobs")
573 self.assertEqual(404, resp.status_code) 573 self.assertEqual(404, resp.status_code)
574 574
575 def test_web_job_noop(self):
576 job = self.get_url("api/tenant/tenant-one/job/noop").json()
577 self.assertEqual("noop", job[0]["name"])
578
575 579
576class TestInfo(BaseTestWeb): 580class TestInfo(BaseTestWeb):
577 581
diff --git a/zuul/model.py b/zuul/model.py
index 5904062..e7cff08 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -1141,7 +1141,10 @@ class Job(ConfigObject):
1141 d['irrelevant_files'] = self._irrelevant_files 1141 d['irrelevant_files'] = self._irrelevant_files
1142 d['variant_description'] = self.variant_description 1142 d['variant_description'] = self.variant_description
1143 d['implied_branch'] = self._implied_branch 1143 d['implied_branch'] = self._implied_branch
1144 d['source_context'] = self.source_context.toDict() 1144 if self.source_context:
1145 d['source_context'] = self.source_context.toDict()
1146 else:
1147 d['source_context'] = None
1145 d['description'] = self.description 1148 d['description'] = self.description
1146 d['required_projects'] = [] 1149 d['required_projects'] = []
1147 for project in self.required_projects.values(): 1150 for project in self.required_projects.values():