Пример #1
0
 def _test_has_offline_migrations(self, revision, expected):
     engine = self.get_engine()
     cfg.CONF.set_override('connection', engine.url, group='database')
     migration.do_alembic_command(self.alembic_config, 'upgrade', revision)
     self.assertEqual(
         expected,
         migration.has_offline_migrations(self.alembic_config, 'unused'))
Пример #2
0
 def _test_has_offline_migrations(self, revision, expected):
     engine = self.get_engine()
     cfg.CONF.set_override('connection', engine.url, group='database')
     migration.do_alembic_command(self.alembic_config, 'upgrade', revision)
     self.assertEqual(expected,
                      migration.has_offline_migrations(self.alembic_config,
                                                       'unused'))
Пример #3
0
 def test_forbid_offline_migrations_starting_newton(self):
     engine = self.get_engine()
     cfg.CONF.set_override('connection', engine.url, group='database')
     # the following revisions are Newton heads
     for revision in ('5cd92597d11d', '5c85685d616d'):
         migration.do_alembic_command(self.alembic_config, 'upgrade',
                                      revision)
     self.assertFalse(
         migration.has_offline_migrations(self.alembic_config, 'unused'),
         msg='Offline contract migration scripts are forbidden for Ocata+')
Пример #4
0
 def test_forbid_offline_migrations_starting_newton(self):
     engine = self.get_engine()
     cfg.CONF.set_override('connection', engine.url, group='database')
     # the following revisions are Newton heads
     for revision in ('5cd92597d11d', '5c85685d616d'):
         migration.do_alembic_command(
             self.alembic_config, 'upgrade', revision)
     self.assertFalse(migration.has_offline_migrations(
         self.alembic_config, 'unused'),
         msg='Offline contract migration scripts are forbidden for Ocata+')
Пример #5
0
 def test_forbid_offline_migrations_starting_newton(self):
     engine = self.get_engine()
     cfg.CONF.set_override("connection", engine.url, group="database")
     # the following revisions are Newton heads
     for revision in ("5cd92597d11d", "5c85685d616d"):
         migration.do_alembic_command(self.alembic_config, "upgrade", revision)
     self.assertFalse(
         migration.has_offline_migrations(self.alembic_config, "unused"),
         msg="Offline contract migration scripts are forbidden for Ocata+",
     )
Пример #6
0
 def _test_has_offline_migrations(self, revision, expected):
     engine = self.get_engine()
     cfg.CONF.set_override("connection", engine.url, group="database")
     migration.do_alembic_command(self.alembic_config, "upgrade", revision)
     self.assertEqual(expected, migration.has_offline_migrations(self.alembic_config, "unused"))