]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Use right body for test_create_missing_specs_name
authorliyingjun <liyingjun1988@gmail.com>
Sat, 6 Sep 2014 05:37:53 +0000 (13:37 +0800)
committerliyingjun <liyingjun1988@gmail.com>
Sat, 6 Sep 2014 06:49:29 +0000 (14:49 +0800)
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

cinder/tests/api/contrib/test_qos_specs_manage.py

index 377d4224b082c1109d82ef878404b88f3b8e8853..f7fe5e68b8c5eb243601ff0b4a874759c88310c3 100644 (file)
@@ -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)