Skip to content

Instantly share code, notes, and snippets.

@zyluo
Created December 19, 2011 08:23
Show Gist options
  • Save zyluo/1496065 to your computer and use it in GitHub Desktop.
Save zyluo/1496065 to your computer and use it in GitHub Desktop.
test_db_api change diff
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py
index bfcc6b8..e11c0dd 100644
--- a/nova/tests/test_db_api.py
+++ b/nova/tests/test_db_api.py
@@ -273,8 +273,8 @@ class _DbApiTestCase(test.TestCase):
self.saved_db_imp = db.api.IMPL
self.saved_migration_imp = db.migration.IMPL
- db.api.IMPL = self.get_db_driver()
- db.migration.IMPL = self.get_migration_driver()
+ #db.api.IMPL = self.get_db_driver()
+ #db.migration.IMPL = self.get_migration_driver()
tests.setup()
super(_DbApiTestCase, self).setUp()
@@ -304,7 +304,8 @@ class _DbApiTestCase(test.TestCase):
self.assertFalse(network[key], '%s was not False by default')
for key in ['virtual_interfaces', 'fixed_ips']:
- self.assertTrue(len(network[key]) == 0, '%s was not of length 0 by
+ self.assertTrue(len(network[key]) == 0,
+ '%s was not of length 0 by default')
def test_network_associate(self):
ctxt = context.get_admin_context()
@@ -448,10 +449,13 @@ class _DbApiTestCase(test.TestCase):
class SQLAlchemyDbDriverTestCase(_DbApiTestCase):
- def get_db_driver(self):
+
+ @staticmethod
+ def get_db_driver():
import nova.db.sqlalchemy.api
return nova.db.sqlalchemy.api
- def get_migration_driver(self):
+ @staticmethod
+ def get_migration_driver():
import nova.db.sqlalchemy.migration
return nova.db.sqlalchemy.migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment