summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlbin Vass <albin.vass@zenseact.com>2022-08-23 13:03:49 +0200
committerAlbin Vass <albin.vass@zenseact.com>2022-08-23 13:21:25 +0200
commit9e88f8e5cb5f54a0f304f6b94898f943b1b53fcc (patch)
tree28c57644a3eea9521655d0dd61f9887b8183dc73 /tests
parent7491e081bd1e08defd98245489e50604d317b6aa (diff)
downloadzuul-9e88f8e5cb5f54a0f304f6b94898f943b1b53fcc.tar.gz
Fix links for jobs with special characters
Change-Id: I12e8a056a2e5cd1bb18c1f24ecd7db55405f0a8c
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/layouts/special-characters-job.yaml2
-rw-r--r--tests/unit/test_web.py5
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/fixtures/layouts/special-characters-job.yaml b/tests/fixtures/layouts/special-characters-job.yaml
new file mode 100644
index 000000000..20308c6d6
--- /dev/null
+++ b/tests/fixtures/layouts/special-characters-job.yaml
@@ -0,0 +1,2 @@
+- job:
+ name: "a@b/c"
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index 53546c1de..ba1931436 100644
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -1005,6 +1005,11 @@ class TestWeb(BaseTestWeb):
job = self.get_url("api/tenant/tenant-one/job/noop").json()
self.assertEqual("noop", job[0]["name"])
+ @simple_layout('layouts/special-characters-job.yaml')
+ def test_web_job_special_characters(self):
+ job = self.get_url("api/tenant/tenant-one/job/a%40b%2Fc").json()
+ self.assertEqual("a@b/c", job[0]["name"])
+
def test_freeze_jobs(self):
# Test can get a list of the jobs for a given project+pipeline+branch.
resp = self.get_url(