From b15bfc2edd5d3dd0dca805786bdcf22d3fb0339d Mon Sep 17 00:00:00 2001 From: Unmesh Gurjar Date: Thu, 22 Mar 2012 11:19:45 +0530 Subject: Fixed status validation. Fixes bug 960884. Fixed the status value validation in os-hosts extension and added a negative scenario in unit test for os-hosts extension. Change-Id: Ib4166757561e531494a1a4d3070d7c8971b57dc5 --- nova/tests/api/openstack/compute/contrib/test_hosts.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/compute/contrib/test_hosts.py b/nova/tests/api/openstack/compute/contrib/test_hosts.py index 76eb77e56..77beeae8c 100644 --- a/nova/tests/api/openstack/compute/contrib/test_hosts.py +++ b/nova/tests/api/openstack/compute/contrib/test_hosts.py @@ -159,6 +159,9 @@ class HostTestCase(test.TestCase): bad_body = {"status": "bad"} self.assertRaises(webob.exc.HTTPBadRequest, self.controller.update, self.req, "host_c1", body=bad_body) + bad_body2 = {"status": "disablabc"} + self.assertRaises(webob.exc.HTTPBadRequest, self.controller.update, + self.req, "host_c1", body=bad_body2) def test_bad_update_key(self): bad_body = {"crazy": "bad"} -- cgit