From 7268f2c991c8fab2064d6927898866fb62dee699 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Thu, 15 Sep 2011 11:44:52 -0400 Subject: [PATCH] Fixes bug 851016. Fixed test_migrations.py so that it runs migrations again. It will also now fail if test_migrations.conf cannot be found. Change-Id: I669cc1dda1dc247dc86c6e271b00d296f8445a15 --- glance/tests/unit/test_migrations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glance/tests/unit/test_migrations.py b/glance/tests/unit/test_migrations.py index bdd5c936e5..0b60051b86 100644 --- a/glance/tests/unit/test_migrations.py +++ b/glance/tests/unit/test_migrations.py @@ -47,7 +47,7 @@ class TestMigrations(unittest.TestCase): # Test machines can set the GLANCE_TEST_MIGRATIONS_CONF variable # to override the location of the config file for migration testing CONFIG_FILE_PATH = os.environ.get('GLANCE_TEST_MIGRATIONS_CONF', - os.path.join('tests', 'unit', + os.path.join('glance', 'tests', 'unit', 'test_migrations.conf')) REPOSITORY_PATH = os.path.join('glance', 'registry', 'db', 'migrate_repo') REPOSITORY = Repository(REPOSITORY_PATH) @@ -69,6 +69,8 @@ def setUp(self): except ConfigParser.ParsingError, e: print ("Failed to read test_migrations.conf config file. " "Got error: %s" % e) + else: + self.fail("Unable to find test_migrations.conf") self.engines = {} for key, value in TestMigrations.TEST_DATABASES.items():