summaryrefslogtreecommitdiff
path: root/tests/unit/test_webapp.py
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2017-08-17 09:54:08 -0700
committerClint Byrum <clint@fewbar.com>2017-08-17 09:54:08 -0700
commit4c3776047c144cf0057611ff6810eea37a97abf0 (patch)
tree22163da7bbadaf3026b8563dc689ee9b3473f79d /tests/unit/test_webapp.py
parent9ed33e234509111ed6c0f94cc3468a94d1b952f3 (diff)
downloadzuul-4c3776047c144cf0057611ff6810eea37a97abf0.tar.gz
Return 404 on unknown tenants
These aren't exceptional, so don't log them as such. Change-Id: I5eb9b0ff2732fb55d21ea066f1b896507b5dba1f
Diffstat (limited to 'tests/unit/test_webapp.py')
-rw-r--r--tests/unit/test_webapp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py
index 5b6950b08..c06fc93db 100644
--- a/tests/unit/test_webapp.py
+++ b/tests/unit/test_webapp.py
@@ -110,3 +110,10 @@ class TestWebapp(ZuulTestCase):
self.webapp.unregister_path('/custom')
self.assertRaises(urllib.error.HTTPError, urllib.request.urlopen, req)
+
+ def test_webapp_404_on_unknown_tenant(self):
+ req = urllib.request.Request(
+ "http://localhost:{}/non-tenant/status.json".format(self.port))
+ e = self.assertRaises(
+ urllib.error.HTTPError, urllib.request.urlopen, req)
+ self.assertEqual(404, e.code)