Changed the exception type for invalid requests to webob.exc.HTTPBadRequest.

This commit is contained in:
Ed Leafe
2011-07-06 16:53:08 +00:00
parent 1d8f22dd32
commit 27f4962914

View File

@@ -14,6 +14,7 @@
# under the License.
import stubout
import webob.exc
from nova import context
from nova import exception
@@ -88,12 +89,12 @@ class HostTestCase(test.TestCase):
def test_bad_status_value(self):
bad_body = {"status": "bad"}
self.assertRaises(ValueError, self.controller.update, self.req,
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.update, self.req,
"host_c1", body=bad_body)
def test_bad_update_key(self):
bad_body = {"crazy": "bad"}
self.assertRaises(ValueError, self.controller.update, self.req,
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.update, self.req,
"host_c1", body=bad_body)
def test_bad_host(self):