Пример #1
0
 def test_get_by_id(self):
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'migration_get')
     db.migration_get(ctxt, fake_migration['id']).AndReturn(fake_migration)
     self.mox.ReplayAll()
     mig = migration.Migration.get_by_id(ctxt, fake_migration['id'])
     self._compare(mig, fake_migration)
Пример #2
0
 def test_get_by_id(self):
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'migration_get')
     db.migration_get(ctxt, fake_migration['id']).AndReturn(fake_migration)
     self.mox.ReplayAll()
     mig = migration.Migration.get_by_id(ctxt, fake_migration['id'])
     self._compare(mig, fake_migration)
Пример #3
0
 def get_by_id(cls, context, migration_id):
     db_migration = db.migration_get(context, migration_id)
     return cls._from_db_object(context, cls(), db_migration)
Пример #4
0
 def get_by_id(cls, context, migration_id):
     db_migration = db.migration_get(context, migration_id)
     return cls._from_db_object(context, cls(), db_migration)