summaryrefslogtreecommitdiff
path: root/tests/unit/test_web.py
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-26 01:11:56 +0000
committerGerrit Code Review <review@openstack.org>2019-02-26 01:11:56 +0000
commit7f05944364d2e1d826a250f34da3a1d5fe24cab3 (patch)
treea6c05559250877125699a3af5f3c22e81e17195a /tests/unit/test_web.py
parente3ed5bd05134429e4b952fa80a0d917d42bfe250 (diff)
parent5776248c9144e0eae7f4a7d233bc21b8802de191 (diff)
downloadzuul-7f05944364d2e1d826a250f34da3a1d5fe24cab3.tar.gz
Merge "scheduler: add job's variants to the rpc job_list method"
Diffstat (limited to 'tests/unit/test_web.py')
-rwxr-xr-xtests/unit/test_web.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index bc9ffa4d2..f2e33c6de 100755
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -659,6 +659,20 @@ class TestWeb(BaseTestWeb):
resp = self.get_url("api/tenant/non-tenant/jobs")
self.assertEqual(404, resp.status_code)
+ def test_jobs_list_variants(self):
+ resp = self.get_url("api/tenant/tenant-one/jobs").json()
+ for job in resp:
+ if job['name'] in ["base", "noop"]:
+ variants = None
+ elif job['name'] == 'project-test1':
+ variants = [
+ {'parent': 'base'},
+ {'branches': ['stable'], 'parent': 'base'},
+ ]
+ else:
+ variants = [{'parent': 'base'}]
+ self.assertEqual(variants, job.get('variants'))
+
def test_web_job_noop(self):
job = self.get_url("api/tenant/tenant-one/job/noop").json()
self.assertEqual("noop", job[0]["name"])