From 155ef7daab08d7f3fb8f7838df1d715bf1dc2f3f Mon Sep 17 00:00:00 2001 From: Hengqing Hu Date: Thu, 8 Mar 2012 16:43:32 +0800 Subject: Make sqlite in-memory-db usable to unittest Move migrate monkey patch from nova.tests.test_migrations to nova.db.sqlalchemy.migration Change-Id: I018e44903558cad6311fd368787583322f962d0c --- nova/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/test.py') diff --git a/nova/test.py b/nova/test.py index 87e1ce322..e44ad57ea 100644 --- a/nova/test.py +++ b/nova/test.py @@ -40,6 +40,7 @@ from nova.openstack.common import cfg from nova import utils from nova import service from nova.testing.fake import rabbit +from nova.tests import reset_db from nova.virt import fake @@ -129,8 +130,7 @@ class TestCase(unittest.TestCase): # now that we have some required db setup for the system # to work properly. self.start = utils.utcnow() - shutil.copyfile(os.path.join(FLAGS.state_path, FLAGS.sqlite_clean_db), - os.path.join(FLAGS.state_path, FLAGS.sqlite_db)) + reset_db() # emulate some of the mox stuff, we can't use the metaclass # because it screws with our generators -- cgit