]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Utilize assertIsInstance
authorZhongyue Luo <zhongyue.nah@intel.com>
Fri, 30 Aug 2013 11:50:26 +0000 (20:50 +0900)
committerGerrit Code Review <review@openstack.org>
Fri, 6 Sep 2013 01:42:07 +0000 (01:42 +0000)
Using assertTrue and the 'isinstance' function to test
if an object is in an instance of some class is too python2.4.
Our unit testing framework supports assertIsInstance which was created
for these types of tests. Let's use assertIsInstance for these tests.

Change-Id: I2c931a52ae20f072f53210bf3dedb47127b413c0

cinder/tests/image/test_glance.py
cinder/tests/scheduler/test_scheduler.py
cinder/tests/test_migrations.py
cinder/tests/test_quota.py

index 0f564fbe8b13daa579f02ccc1f3802ca012ce7c6..0e7576d751b0e380f3060424d2358485c85a0650 100644 (file)
@@ -622,7 +622,7 @@ class TestGlanceImageServiceClient(test.TestCase):
         self.stubs.Set(glance.glanceclient, 'Client', MyGlanceStubClient)
         client = glance._create_glance_client(self.context, 'fake_host:9292',
                                               False)
-        self.assertTrue(isinstance(client, MyGlanceStubClient))
+        self.assertIsInstance(client, MyGlanceStubClient)
 
     def test_create_glance_client_auth_strategy_is_not_keystone(self):
         self.flags(auth_strategy='noauth')
@@ -638,7 +638,7 @@ class TestGlanceImageServiceClient(test.TestCase):
         self.stubs.Set(glance.glanceclient, 'Client', MyGlanceStubClient)
         client = glance._create_glance_client(self.context, 'fake_host:9292',
                                               False)
-        self.assertTrue(isinstance(client, MyGlanceStubClient))
+        self.assertIsInstance(client, MyGlanceStubClient)
 
     def test_create_glance_client_glance_request_default_timeout(self):
         self.flags(auth_strategy='keystone')
@@ -654,7 +654,7 @@ class TestGlanceImageServiceClient(test.TestCase):
         self.stubs.Set(glance.glanceclient, 'Client', MyGlanceStubClient)
         client = glance._create_glance_client(self.context, 'fake_host:9292',
                                               False)
-        self.assertTrue(isinstance(client, MyGlanceStubClient))
+        self.assertIsInstance(client, MyGlanceStubClient)
 
     def tearDown(self):
         self.stubs.UnsetAll()
index ce78f50e64949c074fedb6450ad71fece268a8b6..db783f377cff9a53421a749f86d3f01fac466c1d 100644 (file)
@@ -51,7 +51,7 @@ class SchedulerManagerTestCase(test.TestCase):
     def test_1_correct_init(self):
         # Correct scheduler driver
         manager = self.manager
-        self.assertTrue(isinstance(manager.driver, self.driver_cls))
+        self.assertIsInstance(manager.driver, self.driver_cls)
 
     def test_update_service_capabilities(self):
         service_name = 'fake_service'
index 3d0f85f985649751ce55656060825384ae4b80fb..3228b432500e6f4d21f972252706f59a597fa231 100644 (file)
@@ -478,8 +478,8 @@ class TestMigrations(test.TestCase):
             volumes = sqlalchemy.Table('volumes',
                                        metadata,
                                        autoload=True)
-            self.assertTrue(isinstance(volumes.c.source_volid.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volumes.c.source_volid.type,
+                                  sqlalchemy.types.VARCHAR)
 
     def _metadatas(self, upgrade_to, downgrade_to=None):
         for (key, engine) in self.engines.items():
@@ -507,8 +507,8 @@ class TestMigrations(test.TestCase):
     def test_upgrade_006_adds_provider_location(self):
         for metadata in self.metadatas_upgraded_to(6):
             snapshots = sqlalchemy.Table('snapshots', metadata, autoload=True)
-            self.assertTrue(isinstance(snapshots.c.provider_location.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(snapshots.c.provider_location.type,
+                                  sqlalchemy.types.VARCHAR)
 
     def test_downgrade_006_removes_provider_location(self):
         for metadata in self.metadatas_downgraded_from(6):
@@ -549,44 +549,44 @@ class TestMigrations(test.TestCase):
                                        metadata,
                                        autoload=True)
 
-            self.assertTrue(isinstance(backups.c.created_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(backups.c.updated_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(backups.c.deleted_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(backups.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(backups.c.id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.volume_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.user_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.project_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.host.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.availability_zone.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.display_name.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.display_description.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.container.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.status.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.fail_reason.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.service_metadata.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.service.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(backups.c.size.type,
-                                       sqlalchemy.types.INTEGER))
-            self.assertTrue(isinstance(backups.c.object_count.type,
-                                       sqlalchemy.types.INTEGER))
+            self.assertIsInstance(backups.c.created_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(backups.c.updated_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(backups.c.deleted_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(backups.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(backups.c.id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.volume_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.user_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.project_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.host.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.availability_zone.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.display_name.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.display_description.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.container.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.status.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.fail_reason.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.service_metadata.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.service.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(backups.c.size.type,
+                                  sqlalchemy.types.INTEGER)
+            self.assertIsInstance(backups.c.object_count.type,
+                                  sqlalchemy.types.INTEGER)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 7)
 
@@ -611,24 +611,24 @@ class TestMigrations(test.TestCase):
                                                  metadata,
                                                  autoload=True)
 
-            self.assertTrue(isinstance(snapshot_metadata.c.created_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(snapshot_metadata.c.updated_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(snapshot_metadata.c.deleted_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(snapshot_metadata.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(snapshot_metadata.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(snapshot_metadata.c.id.type,
-                                       sqlalchemy.types.INTEGER))
-            self.assertTrue(isinstance(snapshot_metadata.c.snapshot_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(snapshot_metadata.c.key.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(snapshot_metadata.c.value.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(snapshot_metadata.c.created_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(snapshot_metadata.c.updated_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(snapshot_metadata.c.deleted_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(snapshot_metadata.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(snapshot_metadata.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(snapshot_metadata.c.id.type,
+                                  sqlalchemy.types.INTEGER)
+            self.assertIsInstance(snapshot_metadata.c.snapshot_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(snapshot_metadata.c.key.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(snapshot_metadata.c.value.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 8)
 
@@ -652,26 +652,26 @@ class TestMigrations(test.TestCase):
                                          metadata,
                                          autoload=True)
 
-            self.assertTrue(isinstance(transfers.c.created_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(transfers.c.updated_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(transfers.c.deleted_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(transfers.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(transfers.c.id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(transfers.c.volume_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(transfers.c.display_name.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(transfers.c.salt.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(transfers.c.crypt_hash.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(transfers.c.expires_at.type,
-                                       sqlalchemy.types.DATETIME))
+            self.assertIsInstance(transfers.c.created_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(transfers.c.updated_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(transfers.c.deleted_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(transfers.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(transfers.c.id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(transfers.c.volume_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(transfers.c.display_name.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(transfers.c.salt.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(transfers.c.crypt_hash.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(transfers.c.expires_at.type,
+                                  sqlalchemy.types.DATETIME)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 9)
 
@@ -706,8 +706,8 @@ class TestMigrations(test.TestCase):
             for column in volumes_v10.c:
                 self.assertTrue(volumes.c.__contains__(column.name))
 
-            self.assertTrue(isinstance(volumes.c.bootable.type,
-                                       sqlalchemy.types.BOOLEAN))
+            self.assertIsInstance(volumes.c.bootable.type,
+                                  sqlalchemy.types.BOOLEAN)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 10)
             metadata = sqlalchemy.schema.MetaData()
@@ -736,8 +736,8 @@ class TestMigrations(test.TestCase):
             volumes = sqlalchemy.Table('volumes',
                                        metadata,
                                        autoload=True)
-            self.assertTrue(isinstance(volumes.c.attached_host.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volumes.c.attached_host.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 11)
             metadata = sqlalchemy.schema.MetaData()
@@ -762,8 +762,8 @@ class TestMigrations(test.TestCase):
             volumes = sqlalchemy.Table('volumes',
                                        metadata,
                                        autoload=True)
-            self.assertTrue(isinstance(volumes.c.provider_geometry.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volumes.c.provider_geometry.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 12)
             metadata = sqlalchemy.schema.MetaData()
@@ -788,8 +788,8 @@ class TestMigrations(test.TestCase):
             volumes = sqlalchemy.Table('volumes',
                                        metadata,
                                        autoload=True)
-            self.assertTrue(isinstance(volumes.c._name_id.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volumes.c._name_id.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 13)
             metadata = sqlalchemy.schema.MetaData()
@@ -859,29 +859,29 @@ class TestMigrations(test.TestCase):
             # encryption key UUID
             volumes = sqlalchemy.Table('volumes', metadata, autoload=True)
             self.assertIn('encryption_key_id', volumes.c)
-            self.assertTrue(isinstance(volumes.c.encryption_key_id.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volumes.c.encryption_key_id.type,
+                                  sqlalchemy.types.VARCHAR)
 
             snapshots = sqlalchemy.Table('snapshots', metadata, autoload=True)
             self.assertIn('encryption_key_id', snapshots.c)
-            self.assertTrue(isinstance(snapshots.c.encryption_key_id.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(snapshots.c.encryption_key_id.type,
+                                  sqlalchemy.types.VARCHAR)
             self.assertIn('volume_type_id', snapshots.c)
-            self.assertTrue(isinstance(snapshots.c.volume_type_id.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(snapshots.c.volume_type_id.type,
+                                  sqlalchemy.types.VARCHAR)
 
             # encryption types table
             encryption = sqlalchemy.Table('encryption',
                                           metadata,
                                           autoload=True)
-            self.assertTrue(isinstance(encryption.c.volume_type_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(encryption.c.cipher.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(encryption.c.key_size.type,
-                                       sqlalchemy.types.INTEGER))
-            self.assertTrue(isinstance(encryption.c.provider.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(encryption.c.volume_type_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(encryption.c.cipher.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(encryption.c.key_size.type,
+                                  sqlalchemy.types.INTEGER)
+            self.assertIsInstance(encryption.c.provider.type,
+                                  sqlalchemy.types.VARCHAR)
 
             # downgrade schema
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 16)
@@ -913,22 +913,22 @@ class TestMigrations(test.TestCase):
             qos_specs = sqlalchemy.Table('quality_of_service_specs',
                                          metadata,
                                          autoload=True)
-            self.assertTrue(isinstance(qos_specs.c.created_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(qos_specs.c.updated_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(qos_specs.c.deleted_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(qos_specs.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(qos_specs.c.id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(qos_specs.c.specs_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(qos_specs.c.key.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(qos_specs.c.value.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(qos_specs.c.created_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(qos_specs.c.updated_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(qos_specs.c.deleted_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(qos_specs.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(qos_specs.c.id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(qos_specs.c.specs_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(qos_specs.c.key.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(qos_specs.c.value.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 17)
 
@@ -949,8 +949,8 @@ class TestMigrations(test.TestCase):
             volumes = sqlalchemy.Table('volumes',
                                        metadata,
                                        autoload=True)
-            self.assertTrue(isinstance(volumes.c.migration_status.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volumes.c.migration_status.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 18)
             metadata = sqlalchemy.schema.MetaData()
@@ -979,24 +979,24 @@ class TestMigrations(test.TestCase):
                                                      metadata,
                                                      autoload=True)
 
-            self.assertTrue(isinstance(volume_admin_metadata.c.created_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(volume_admin_metadata.c.updated_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(volume_admin_metadata.c.deleted_at.type,
-                                       sqlalchemy.types.DATETIME))
-            self.assertTrue(isinstance(volume_admin_metadata.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(volume_admin_metadata.c.deleted.type,
-                                       sqlalchemy.types.BOOLEAN))
-            self.assertTrue(isinstance(volume_admin_metadata.c.id.type,
-                                       sqlalchemy.types.INTEGER))
-            self.assertTrue(isinstance(volume_admin_metadata.c.volume_id.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(volume_admin_metadata.c.key.type,
-                                       sqlalchemy.types.VARCHAR))
-            self.assertTrue(isinstance(volume_admin_metadata.c.value.type,
-                                       sqlalchemy.types.VARCHAR))
+            self.assertIsInstance(volume_admin_metadata.c.created_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(volume_admin_metadata.c.updated_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(volume_admin_metadata.c.deleted_at.type,
+                                  sqlalchemy.types.DATETIME)
+            self.assertIsInstance(volume_admin_metadata.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(volume_admin_metadata.c.deleted.type,
+                                  sqlalchemy.types.BOOLEAN)
+            self.assertIsInstance(volume_admin_metadata.c.id.type,
+                                  sqlalchemy.types.INTEGER)
+            self.assertIsInstance(volume_admin_metadata.c.volume_id.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(volume_admin_metadata.c.key.type,
+                                  sqlalchemy.types.VARCHAR)
+            self.assertIsInstance(volume_admin_metadata.c.value.type,
+                                  sqlalchemy.types.VARCHAR)
 
             migration_api.downgrade(engine, TestMigrations.REPOSITORY, 19)
 
index 3c2c1fb878ecc24b617a83ee798f00fbe4e7f243..99b2ed2c9d5c1b21ba8411a51c7ce3086022406e 100644 (file)
@@ -380,14 +380,14 @@ class QuotaEngineTestCase(test.TestCase):
         quota_obj = quota.QuotaEngine()
 
         self.assertEqual(quota_obj.resources, {})
-        self.assertTrue(isinstance(quota_obj._driver, quota.DbQuotaDriver))
+        self.assertIsInstance(quota_obj._driver, quota.DbQuotaDriver)
 
     def test_init_override_string(self):
         quota_obj = quota.QuotaEngine(
             quota_driver_class='cinder.tests.test_quota.FakeDriver')
 
         self.assertEqual(quota_obj.resources, {})
-        self.assertTrue(isinstance(quota_obj._driver, FakeDriver))
+        self.assertIsInstance(quota_obj._driver, FakeDriver)
 
     def test_init_override_obj(self):
         quota_obj = quota.QuotaEngine(quota_driver_class=FakeDriver)