]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Python 3: fix a lot of tests
authorCyril Roelandt <cyril@redhat.com>
Wed, 2 Dec 2015 15:15:43 +0000 (16:15 +0100)
committerCyril Roelandt <cyril@redhat.com>
Mon, 7 Dec 2015 14:34:20 +0000 (15:34 +0100)
As of this commit, the following tests should now be working with Python 3:

- cinder.tests.unit.api.contrib.test_cgsnapshots
- cinder.tests.unit.api.contrib.test_scheduler_hints
- cinder.tests.unit.api.contrib.test_snapshot_actions
- cinder.tests.unit.api.contrib.test_snapshot_manage
- cinder.tests.unit.api.contrib.test_snapshot_unmanage
- cinder.tests.unit.api.contrib.test_volume_encryption_metadata
- cinder.tests.unit.api.contrib.test_volume_host_attribute
- cinder.tests.unit.api.contrib.test_volume_manage
- cinder.tests.unit.api.contrib.test_volume_migration_status_attribute
- cinder.tests.unit.api.contrib.test_volume_tenant_attribute
- cinder.tests.unit.api.contrib.test_volume_unmanage
- cinder.tests.unit.api.v2.test_volumes

Most changes in this patch:
- make sure that Request.body is set to bytes;
- replace jsonutils.dumps with jsonutils.dump_as_bytes;
- replace json.loads with oslo_serialization.jsonutils.loads;
- replace dict.iteritems with dict.items.

Partial-Implements: blueprint cinder-python3
Change-Id: Icbb96ff84b7012b58f7296eea4fbcd620e081614

13 files changed:
cinder/tests/unit/api/contrib/test_cgsnapshots.py
cinder/tests/unit/api/contrib/test_scheduler_hints.py
cinder/tests/unit/api/contrib/test_snapshot_actions.py
cinder/tests/unit/api/contrib/test_snapshot_manage.py
cinder/tests/unit/api/contrib/test_snapshot_unmanage.py
cinder/tests/unit/api/contrib/test_volume_encryption_metadata.py
cinder/tests/unit/api/contrib/test_volume_host_attribute.py
cinder/tests/unit/api/contrib/test_volume_manage.py
cinder/tests/unit/api/contrib/test_volume_migration_status_attribute.py
cinder/tests/unit/api/contrib/test_volume_tenant_attribute.py
cinder/tests/unit/api/contrib/test_volume_unmanage.py
cinder/volume/api.py
tests-py3.txt

index 7ba5bcb9f08941bf12fd2b52ca91e5331eeed6f6..6206a3a50b3c64059da712096d1cb72d465286c2 100644 (file)
 Tests for cgsnapshot code.
 """
 
-import json
 from xml.dom import minidom
 
 import mock
+from oslo_serialization import jsonutils
 import webob
 
 from cinder.consistencygroup import api as consistencygroupAPI
@@ -56,7 +56,7 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req.method = 'GET'
         req.headers['Content-Type'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(200, res.status_int)
         self.assertEqual('this is a test cgsnapshot',
@@ -100,7 +100,7 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req.method = 'GET'
         req.headers['Content-Type'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(404, res.status_int)
         self.assertEqual(404, res_dict['itemNotFound']['code'])
@@ -123,7 +123,7 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req.method = 'GET'
         req.headers['Content-Type'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(200, res.status_int)
         self.assertEqual(cgsnapshot1.id,
@@ -199,7 +199,7 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req.headers['Content-Type'] = 'application/json'
         req.headers['Accept'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(200, res.status_int)
         self.assertEqual('this is a test cgsnapshot',
@@ -315,10 +315,10 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req = webob.Request.blank('/v2/fake/cgsnapshots')
         req.method = 'POST'
         req.headers['Content-Type'] = 'application/json'
-        req.body = json.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(fakes.wsgi_app())
 
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(202, res.status_int)
         self.assertIn('id', res_dict['cgsnapshot'])
@@ -332,12 +332,12 @@ class CgsnapshotsAPITestCase(test.TestCase):
     def test_create_cgsnapshot_with_no_body(self):
         # omit body from the request
         req = webob.Request.blank('/v2/fake/cgsnapshots')
-        req.body = json.dumps(None)
+        req.body = jsonutils.dump_as_bytes(None)
         req.method = 'POST'
         req.headers['Content-Type'] = 'application/json'
         req.headers['Accept'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(400, res.status_int)
         self.assertEqual(400, res_dict['badRequest']['code'])
@@ -358,11 +358,11 @@ class CgsnapshotsAPITestCase(test.TestCase):
                                "CG Snapshot 1",
                                "consistencygroup_id": consistencygroup.id}}
         req = webob.Request.blank('/v2/fake/cgsnapshots')
-        req.body = json.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         req.method = 'POST'
         req.headers['Content-Type'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(400, res.status_int)
         self.assertEqual(400, res_dict['badRequest']['code'])
@@ -386,9 +386,9 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req = webob.Request.blank('/v2/fake/cgsnapshots')
         req.method = 'POST'
         req.headers['Content-Type'] = 'application/json'
-        req.body = json.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(404, res.status_int)
         self.assertEqual(404, res_dict['itemNotFound']['code'])
@@ -425,7 +425,7 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req.method = 'DELETE'
         req.headers['Content-Type'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(404, res.status_int)
         self.assertEqual(404, res_dict['itemNotFound']['code'])
@@ -446,7 +446,7 @@ class CgsnapshotsAPITestCase(test.TestCase):
         req.method = 'DELETE'
         req.headers['Content-Type'] = 'application/json'
         res = req.get_response(fakes.wsgi_app())
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         self.assertEqual(400, res.status_int)
         self.assertEqual(400, res_dict['badRequest']['code'])
index fde7748522bd1a66b0c06c66151082a076eebc5f..2e0e09c2512c88ddd49b0028c6ea27fc2e785cf0 100644 (file)
@@ -57,7 +57,7 @@ class SchedulerHintsTestCase(test.TestCase):
         body = {'id': id,
                 'volume_type_id': 'cedef40a-ed67-4d10-800e-17455edce175',
                 'volume_id': '1', }
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(self.app)
         self.assertEqual(202, res.status_int)
 
@@ -80,7 +80,7 @@ class SchedulerHintsTestCase(test.TestCase):
                 'volume_id': '1',
                 'scheduler_hints': {'a': 'b'}, }
 
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(self.app)
         self.assertEqual(202, res.status_int)
 
@@ -94,6 +94,6 @@ class SchedulerHintsTestCase(test.TestCase):
             'volume_id': '1',
             'scheduler_hints': 'a', }}
 
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(self.app)
         self.assertEqual(400, res.status_int)
index ba00c44a47ea50e408c9c67a085487f7ef3c8f72..e9350140eda5d495b49fcfe38fc54eb6bc9c2e7a 100644 (file)
@@ -49,7 +49,7 @@ class SnapshotActionsTest(test.TestCase):
         body = {'os-update_snapshot_status': {'status': 'available'}}
         req = webob.Request.blank('/v2/fake/snapshots/1/action')
         req.method = "POST"
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         req.headers["content-type"] = "application/json"
 
         res = req.get_response(fakes.wsgi_app())
@@ -62,7 +62,7 @@ class SnapshotActionsTest(test.TestCase):
         body = {'os-update_snapshot_status': {'status': 'in-use'}}
         req = webob.Request.blank('/v2/fake/snapshots/1/action')
         req.method = "POST"
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         req.headers["content-type"] = "application/json"
 
         res = req.get_response(fakes.wsgi_app())
@@ -73,7 +73,7 @@ class SnapshotActionsTest(test.TestCase):
         body = {'os-update_snapshot_status': {}}
         req = webob.Request.blank('/v2/fake/snapshots/1/action')
         req.method = "POST"
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         req.headers["content-type"] = "application/json"
 
         res = req.get_response(fakes.wsgi_app())
index 9e36c6451e239b38f3251fbcc13026a5bee2821b..a6ff239984da1f5c5a6fd78ef2c1c4e834dfe677 100644 (file)
@@ -62,7 +62,7 @@ class SnapshotManageTest(test.TestCase):
         req.environ['cinder.context'] = context.RequestContext('admin',
                                                                'fake',
                                                                True)
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(app())
         return res
 
index 4ce70f109f68a2ddc41c1a255e5d09d388a2f301..cf8729749e116c48144cbca8947ccec5869f39ee 100644 (file)
@@ -80,7 +80,7 @@ class SnapshotUnmanageTest(test.TestCase):
                                                                'fake',
                                                                True)
         body = {'os-unmanage': ''}
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(app())
         return res
 
index fab674eb3fa0e516b2b2a4445f1ae6fee98e4843..1dd1935b3e06fcf06aeb5246763aa1e130ab6729 100644 (file)
@@ -13,8 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import json
-
+from oslo_serialization import jsonutils
 import webob
 
 from cinder.api.contrib import volume_encryption_metadata
@@ -81,7 +80,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
                                   % self.volume_id)
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(200, res.status_code)
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         expected = {
             "encryption_key_id": "fake_key",
@@ -98,7 +97,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(400, res.status_code)
 
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
         expected = {'badRequest': {'code': 400,
                                    'message': 'Malformed request url'}}
         self.assertEqual(expected, res_dict)
@@ -110,7 +109,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(404, res.status_code)
 
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
         expected = {'itemNotFound': {'code': 404,
                                      'message': 'VolumeNotFound: Volume '
                                                 '%s could not be found.'
@@ -123,7 +122,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(200, res.status_code)
 
-        self.assertEqual('fake_key', res.body)
+        self.assertEqual(b'fake_key', res.body)
 
     def test_show_control(self):
         req = webob.Request.blank('/v2/fake/volumes/%s/encryption/'
@@ -131,7 +130,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(200, res.status_code)
 
-        self.assertEqual('front-end', res.body)
+        self.assertEqual(b'front-end', res.body)
 
     def test_show_provider(self):
         req = webob.Request.blank('/v2/fake/volumes/%s/encryption/'
@@ -139,7 +138,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(200, res.status_code)
 
-        self.assertEqual('nova.volume.encryptors.base.VolumeEncryptor',
+        self.assertEqual(b'nova.volume.encryptors.base.VolumeEncryptor',
                          res.body)
 
     def test_show_bad_tenant_id(self):
@@ -149,7 +148,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(400, res.status_code)
 
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
         expected = {'badRequest': {'code': 400,
                                    'message': 'Malformed request url'}}
         self.assertEqual(expected, res_dict)
@@ -161,7 +160,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
         self.assertEqual(404, res.status_code)
 
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
         expected = {'itemNotFound': {'code': 404,
                                      'message': 'VolumeNotFound: Volume '
                                                 '%s could not be found.'
@@ -176,7 +175,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=ctxt))
         self.assertEqual(200, res.status_code)
 
-        self.assertEqual('fake_key', res.body)
+        self.assertEqual(b'fake_key', res.body)
 
     def test_show_volume_not_encrypted_type(self):
         self.stubs.Set(db.sqlalchemy.api, 'volume_type_encryption_get',
@@ -203,7 +202,7 @@ class VolumeEncryptionMetadataTest(test.TestCase):
         res = req.get_response(fakes.wsgi_app(fake_auth_context=self.ctxt))
 
         self.assertEqual(200, res.status_code)
-        res_dict = json.loads(res.body)
+        res_dict = jsonutils.loads(res.body)
 
         expected = {
             'encryption_key_id': None
index f6fe4919cf5ab1f087e1873c19b0a02161ef0405..ae5b70732f80559f38b28909a10217245110bafd 100644 (file)
 #   License for the specific language governing permissions and limitations
 #   under the License.
 
-import json
 import uuid
 
 from lxml import etree
+from oslo_serialization import jsonutils
 from oslo_utils import timeutils
 import webob
 
@@ -82,7 +82,7 @@ class VolumeHostAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volume']
+        vol = jsonutils.loads(res.body)['volume']
         self.assertEqual('host001', vol['os-vol-host-attr:host'])
 
     def test_get_volume_unallowed(self):
@@ -91,7 +91,7 @@ class VolumeHostAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volume']
+        vol = jsonutils.loads(res.body)['volume']
         self.assertNotIn('os-vol-host-attr:host', vol)
 
     def test_list_detail_volumes_allowed(self):
@@ -100,7 +100,7 @@ class VolumeHostAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertEqual('host001', vol[0]['os-vol-host-attr:host'])
 
     def test_list_detail_volumes_unallowed(self):
@@ -109,7 +109,7 @@ class VolumeHostAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertNotIn('os-vol-host-attr:host', vol[0])
 
     def test_list_simple_volumes_no_host(self):
@@ -118,7 +118,7 @@ class VolumeHostAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertNotIn('os-vol-host-attr:host', vol[0])
 
     def test_get_volume_xml(self):
index d6de78a3e32d491c2b37bfb0f61c8aee52914b53..57c69f3ec04ec723d218635d045965b273833a7f 100644 (file)
@@ -130,7 +130,7 @@ class VolumeManageTest(test.TestCase):
         req.environ['cinder.context'] = context.RequestContext('admin',
                                                                'fake',
                                                                True)
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(app())
         return res
 
index a3cc246d337f87313bc71f0253cbb6b96a426a1f..f27257f6b4c82714b7ee8b17ac458a99e245e6d6 100644 (file)
 # License for the specific language governing permissions and limitations
 # under the License.
 
-import json
 import uuid
 
 from lxml import etree
+from oslo_serialization import jsonutils
 from oslo_utils import timeutils
 import webob
 
@@ -78,7 +78,7 @@ class VolumeMigStatusAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volume']
+        vol = jsonutils.loads(res.body)['volume']
         self.assertEqual('migrating', vol['os-vol-mig-status-attr:migstat'])
         self.assertEqual('fake2', vol['os-vol-mig-status-attr:name_id'])
 
@@ -88,7 +88,7 @@ class VolumeMigStatusAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volume']
+        vol = jsonutils.loads(res.body)['volume']
         self.assertNotIn('os-vol-mig-status-attr:migstat', vol)
         self.assertNotIn('os-vol-mig-status-attr:name_id', vol)
 
@@ -98,7 +98,7 @@ class VolumeMigStatusAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertEqual('migrating', vol[0]['os-vol-mig-status-attr:migstat'])
         self.assertEqual('fake2', vol[0]['os-vol-mig-status-attr:name_id'])
 
@@ -108,7 +108,7 @@ class VolumeMigStatusAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertNotIn('os-vol-mig-status-attr:migstat', vol[0])
         self.assertNotIn('os-vol-mig-status-attr:name_id', vol[0])
 
@@ -118,7 +118,7 @@ class VolumeMigStatusAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertNotIn('os-vol-mig-status-attr:migstat', vol[0])
         self.assertNotIn('os-vol-mig-status-attr:name_id', vol[0])
 
index 54e2554546e69554edf7c85b6fdef3810d22bf5e..201af635ec3d620aaf7191154f246c3c6c653ce1 100644 (file)
 #   License for the specific language governing permissions and limitations
 #   under the License.
 
-import json
 import uuid
 
 from lxml import etree
+from oslo_serialization import jsonutils
 import webob
 
 from cinder import context
@@ -64,7 +64,7 @@ class VolumeTenantAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volume']
+        vol = jsonutils.loads(res.body)['volume']
         self.assertEqual(PROJECT_ID, vol['os-vol-tenant-attr:tenant_id'])
 
     def test_get_volume_unallowed(self):
@@ -73,7 +73,7 @@ class VolumeTenantAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volume']
+        vol = jsonutils.loads(res.body)['volume']
         self.assertNotIn('os-vol-tenant-attr:tenant_id', vol)
 
     def test_list_detail_volumes_allowed(self):
@@ -82,7 +82,7 @@ class VolumeTenantAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertEqual(PROJECT_ID, vol[0]['os-vol-tenant-attr:tenant_id'])
 
     def test_list_detail_volumes_unallowed(self):
@@ -91,7 +91,7 @@ class VolumeTenantAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertNotIn('os-vol-tenant-attr:tenant_id', vol[0])
 
     def test_list_simple_volumes_no_tenant_id(self):
@@ -100,7 +100,7 @@ class VolumeTenantAttributeTest(test.TestCase):
         req.method = 'GET'
         req.environ['cinder.context'] = ctx
         res = req.get_response(app())
-        vol = json.loads(res.body)['volumes']
+        vol = jsonutils.loads(res.body)['volumes']
         self.assertNotIn('os-vol-tenant-attr:tenant_id', vol[0])
 
     def test_get_volume_xml(self):
index e94d8ad09f3aa288487643add4da35532745fcba..34403a86f966c8e80f8bbb44aa452946643cbca0 100644 (file)
@@ -127,7 +127,7 @@ class VolumeUnmanageTest(test.TestCase):
                                                                'fake',
                                                                True)
         body = {'os-unmanage': ''}
-        req.body = jsonutils.dumps(body)
+        req.body = jsonutils.dump_as_bytes(body)
         res = req.get_response(app())
         return res
 
index ac01271a3ea7fcac94217b7be276fbf6f2dd3240..f89ed4aae644a458123e21909c88aebc6765553e 100644 (file)
@@ -1712,7 +1712,7 @@ class API(base.Base):
 
     def check_volume_filters(self, filters):
         booleans = self.db.get_booleans_for_table('volume')
-        for k, v in filters.iteritems():
+        for k, v in filters.items():
             try:
                 if k in booleans:
                     filters[k] = bool(v)
index 3b29d79175d20fcc697c4957e3d86e0ff3157573..9874e0efa9dd131c4eb34cb0b093ba5d59869ca7 100644 (file)
@@ -1,21 +1,33 @@
 cinder.tests.unit.api.contrib.test_admin_actions
 cinder.tests.unit.api.contrib.test_availability_zones
 cinder.tests.unit.api.contrib.test_capabilities
+cinder.tests.unit.api.contrib.test_cgsnapshots
 cinder.tests.unit.api.contrib.test_extended_snapshot_attributes
 cinder.tests.unit.api.contrib.test_hosts
 cinder.tests.unit.api.contrib.test_qos_specs_manage
 cinder.tests.unit.api.contrib.test_quotas
 cinder.tests.unit.api.contrib.test_quotas_classes
+cinder.tests.unit.api.contrib.test_scheduler_hints
 cinder.tests.unit.api.contrib.test_scheduler_stats
 cinder.tests.unit.api.contrib.test_services
+cinder.tests.unit.api.contrib.test_snapshot_actions
+cinder.tests.unit.api.contrib.test_snapshot_manage
+cinder.tests.unit.api.contrib.test_snapshot_unmanage
 cinder.tests.unit.api.contrib.test_types_extra_specs
 cinder.tests.unit.api.contrib.test_types_manage
 cinder.tests.unit.api.contrib.test_used_limits
+cinder.tests.unit.api.contrib.test_volume_encryption_metadata
+cinder.tests.unit.api.contrib.test_volume_host_attribute
+cinder.tests.unit.api.contrib.test_volume_manage
+cinder.tests.unit.api.contrib.test_volume_unmanage
+cinder.tests.unit.api.contrib.test_volume_migration_status_attribute
+cinder.tests.unit.api.contrib.test_volume_tenant_attribute
 cinder.tests.unit.api.openstack.test_wsgi
 cinder.tests.unit.api.test_common
 cinder.tests.unit.api.test_extensions
 cinder.tests.unit.api.test_versions
 cinder.tests.unit.api.test_xmlutil
+cinder.tests.unit.api.v2.test_volumes
 cinder.tests.unit.image.test_cache
 cinder.tests.unit.image.test_glance
 cinder.tests.unit.keymgr.test_barbican