From: liyingjun Date: Sat, 6 Sep 2014 05:37:53 +0000 (+0800) Subject: Use right body for test_create_missing_specs_name X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ee6299620ec1ce5c5ff22e0888e00a70b840a708;p=openstack-build%2Fcinder-build.git Use right body for test_create_missing_specs_name Since the test is `test_create_missing_specs_name`, we should define the the body like `body = {'qos_specs': {'a': 'b'}}`. And add a test to cover the invalid body case. Change-Id: Ib1cf9a8b5bfddc0091e28e3765a36c75044642f3 Closes-bug: #1370308 --- diff --git a/cinder/tests/api/contrib/test_qos_specs_manage.py b/cinder/tests/api/contrib/test_qos_specs_manage.py index 377d4224b..f7fe5e68b 100644 --- a/cinder/tests/api/contrib/test_qos_specs_manage.py +++ b/cinder/tests/api/contrib/test_qos_specs_manage.py @@ -323,10 +323,14 @@ class QoSSpecManageApiTest(test.TestCase): def test_create_no_body(self): self._create_qos_specs_bad_body(body=None) - def test_create_missing_specs_name(self): + def test_create_invalid_body(self): body = {'foo': {'a': 'b'}} self._create_qos_specs_bad_body(body=body) + def test_create_missing_specs_name(self): + body = {'qos_specs': {'a': 'b'}} + self._create_qos_specs_bad_body(body=body) + def test_create_malformed_entity(self): body = {'qos_specs': 'string'} self._create_qos_specs_bad_body(body=body)