예제 #1
0
 def test_save(self):
     ctxt = context.get_admin_context()
     fake_migration = fake_db_migration()
     self.mox.StubOutWithMock(db, 'migration_update')
     db.migration_update(ctxt, 123, {'source_compute': 'foo'}
                         ).AndReturn(fake_migration)
     self.mox.ReplayAll()
     mig = migration.Migration(context=ctxt)
     mig.id = 123
     mig.source_compute = 'foo'
     mig.save()
     self.assertEqual(fake_migration['dest_compute'], mig.dest_compute)
예제 #2
0
 def test_save(self):
     ctxt = context.get_admin_context()
     fake_migration = fake_db_migration()
     self.mox.StubOutWithMock(db, 'migration_update')
     db.migration_update(ctxt, 123, {
         'source_compute': 'foo'
     }).AndReturn(fake_migration)
     self.mox.ReplayAll()
     mig = migration.Migration(context=ctxt)
     mig.id = 123
     mig.source_compute = 'foo'
     mig.save()
     self.assertEqual(fake_migration['dest_compute'], mig.dest_compute)
예제 #3
0
파일: migration.py 프로젝트: hsluoyz/patron
 def save(self):
     updates = self.obj_get_changes()
     updates.pop('id', None)
     db_migration = db.migration_update(self._context, self.id, updates)
     self._from_db_object(self._context, self, db_migration)
     self.obj_reset_changes()
예제 #4
0
 def save(self):
     updates = self.obj_get_changes()
     updates.pop('id', None)
     db_migration = db.migration_update(self._context, self.id, updates)
     self._from_db_object(self._context, self, db_migration)
     self.obj_reset_changes()