Render content-type appropriate 404 (bug 1089987)
Change-Id: I8d6acdaa7f8220341bca15cc4acba807910f6891
This commit is contained in:
parent
f75b0e2c39
commit
ec7b94d2ef
|
@ -415,7 +415,8 @@ class Router(object):
|
|||
"""
|
||||
match = req.environ['wsgiorg.routing_args'][1]
|
||||
if not match:
|
||||
return webob.exc.HTTPNotFound()
|
||||
return render_exception(
|
||||
exception.NotFound('The resource could not be found.'))
|
||||
app = match['controller']
|
||||
return app
|
||||
|
||||
|
|
|
@ -312,6 +312,18 @@ class CoreApiTests(object):
|
|||
self.assertIsNotNone(tenant.get('id'))
|
||||
self.assertIsNotNone(tenant.get('name'))
|
||||
|
||||
def test_public_not_found(self):
|
||||
r = self.public_request(
|
||||
path='/%s' % uuid.uuid4().hex,
|
||||
expected_status=404)
|
||||
self.assertValidErrorResponse(r)
|
||||
|
||||
def test_admin_not_found(self):
|
||||
r = self.admin_request(
|
||||
path='/%s' % uuid.uuid4().hex,
|
||||
expected_status=404)
|
||||
self.assertValidErrorResponse(r)
|
||||
|
||||
def test_public_multiple_choice(self):
|
||||
r = self.public_request(path='/', expected_status=300)
|
||||
self.assertValidMultipleChoiceResponse(r)
|
||||
|
|
Loading…
Reference in New Issue