summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-07-20 20:42:09 +0000
committerTarmac <>2011-07-20 20:42:09 +0000
commit15d53966c321e9ec13345d4130ae2e5b98652ec5 (patch)
tree55714fdb31b4d1a672b5f0efc43ec1bce57b490f /nova/tests
parente8ea08c3a08ead45061fcca1ac051e7220ec0523 (diff)
parent1b423b464e0dd849d1a6dafde08b3c4420217151 (diff)
Set the status_int on fault wrapped exceptions. Fixes WSGI logging issues when faults are returned.
Updated so that webob exceptions aren't used for the happy path (HTTP 200 responses). We now return a proper webob object response in these cases. This fixes issues where HTML/XML would get incorrectly returned with the old style happy path exceptions.
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/test_faults.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_faults.py b/nova/tests/api/openstack/test_faults.py
index 4d86ffb26..927009e77 100644
--- a/nova/tests/api/openstack/test_faults.py
+++ b/nova/tests/api/openstack/test_faults.py
@@ -139,3 +139,8 @@ class TestFaults(test.TestCase):
self.assertEqual(resp.content_type, "application/xml")
self.assertEqual(resp.status_int, 404)
self.assertTrue('whut?' in resp.body)
+
+ def test_fault_has_status_int(self):
+ """Ensure the status_int is set correctly on faults"""
+ fault = faults.Fault(webob.exc.HTTPBadRequest(explanation='what?'))
+ self.assertEqual(fault.status_int, 400)