def upgradeAndAssert(self, original, expected):
     self._engine.execute(sqlalchemy.text("insert into sports (id_sports, name, weight, color, met, max_pace)"
                                          " values (:id, :name, :weight, :color, :met, :max_pace)"),
                                        id= 1,
                                        name= "Test Sport",
                                        weight= original["weight"],
                                        color= original["color"],
                                        met= original["met"],
                                        max_pace= original["max_pace"])
     version014.upgrade(self._engine)
     result = self._engine.execute(self._sports_table.select(self._sports_table.c.id_sports==1))
     (_, _, weight, color, met, max_pace) = result.fetchone()
     result.close()
     self.assertEqual(expected["weight"], weight)
     self.assertEqual(expected["color"], color)
     self.assertEqual(expected["met"], met)
     self.assertEqual(expected["max_pace"], max_pace)
Beispiel #2
0
 def upgradeAndAssert(self, original, expected):
     self._engine.execute(sqlalchemy.text("insert into sports (id_sports, name, weight, color, met, max_pace)"
                                          " values (:id, :name, :weight, :color, :met, :max_pace)"),
                                        id= 1,
                                        name= "Test Sport",
                                        weight= original["weight"],
                                        color= original["color"],
                                        met= original["met"],
                                        max_pace= original["max_pace"])
     version014.upgrade(self._engine)
     result = self._engine.execute(self._sports_table.select(self._sports_table.c.id_sports==1))
     (_, _, weight, color, met, max_pace) = result.fetchone()
     result.close()
     self.assertEqual(expected["weight"], weight)
     self.assertEqual(expected["color"], color)
     self.assertEqual(expected["met"], met)
     self.assertEqual(expected["max_pace"], max_pace)
def upgrade(migrate_engine=None):
    if migrate_engine is None:
        # sqlalchemy-migrate 0.5.4 does not provide migrate engine to upgrade scripts
        migrate_engine = sqlalchemy.create_engine(UPGRADE_CONTEXT.db_url)
    version14.upgrade(migrate_engine)
Beispiel #4
0
def upgrade(migrate_engine=None):
    if migrate_engine is None:
        # sqlalchemy-migrate 0.5.4 does not provide migrate engine to upgrade scripts
        migrate_engine = sqlalchemy.create_engine(UPGRADE_CONTEXT.db_url)
    version14.upgrade(migrate_engine)