summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2019-03-28 10:50:52 +0000
committerStephen Finucane <stephenfin@redhat.com>2019-03-28 13:42:22 +0000
commitb5e46d058a792073eed83202e83b1c7493bd811a (patch)
tree1f3ee905e1524a1fa0fb6dbdea94813a4c18e34a /tests
parent33fb2dbdd31e1f5aa90f2536b3d3d032679b81da (diff)
downloadzuul-b5e46d058a792073eed83202e83b1c7493bd811a.tar.gz
web: Add '/' API route
At present, navigating to '/api' will redirect you to '/status'. This makes things a little less discoverable than they should be. Documentation can solve a lot of problems here but simply returning _something_ to let people know the API lives here is a good first step. File permissions for the 'tests/unit/test_web.py' file are fixed. Change-Id: I34b8890146db8adbf54f5b7e0c2fabb4ba819ec2
Diffstat (limited to 'tests')
-rw-r--r--[-rwxr-xr-x]tests/unit/test_web.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index 211f7cb1d..58edc49f5 100755..100644
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -91,6 +91,14 @@ class BaseTestWeb(ZuulTestCase):
class TestWeb(BaseTestWeb):
+ def test_web_index(self):
+ "Test that we can retrieve the index page"
+ resp = self.get_url('api')
+ data = resp.json()
+ # no point checking the whole thing; just make sure _something_ we
+ # expect is here
+ self.assertIn('info', data)
+
def test_web_status(self):
"Test that we can retrieve JSON status info"
self.add_base_changes()