Remove .json suffix from web routes
For the existing simple cases, like builds, jobs and status, having the json
suffix is a perfectly reasonable thing. However, in the next patch it starts
to get weird. When we add support for specific changes or specific jobs, we
we grow URLs like:
/openstack/status.json
/openstack/status/change/537010,2.json
Those read weird, because change/537010,2 is much more like an argument or
specialiation of status. The thing that reads weird is the status call having
.json but the change-specific call just being status/, not
the trailing .json on the change url.
Removing the json suffix gets us:
/openstack/status
/openstack/status/change/537010,2
which feels better as the status portion of the url remains consistent.
This is done first in the stack so that as we add tests for new
endpoints we can get them right the first time rather than having a big
rename patch at the end (which is what this started as)
Change-Id: I4baf33fdacaf46943fbd192743551bb27bd618de
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index b5ebe9f..35827a0 100644
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -89,7 +89,7 @@
self.waitUntilSettled()
req = urllib.request.Request(
- "http://localhost:%s/tenant-one/status.json" % self.port)
+ "http://localhost:%s/tenant-one/status" % self.port)
f = urllib.request.urlopen(req)
headers = f.info()
self.assertIn('Content-Length', headers)
@@ -230,7 +230,7 @@
@skip("This returns a 500")
def test_web_404_on_unknown_tenant(self):
req = urllib.request.Request(
- "http://localhost:{}/non-tenant/status.json".format(self.port))
+ "http://localhost:{}/non-tenant/status".format(self.port))
e = self.assertRaises(
urllib.error.HTTPError, urllib.request.urlopen, req)
self.assertEqual(404, e.code)