Ejemplo n.º 1
0
 def test_save(self):
     self.mox.StubOutWithMock(db, 'service_update')
     db.service_update(self.context, 123, {'host': 'fake-host'}).AndReturn(
         fake_service)
     self.mox.ReplayAll()
     service_obj = service.Service(context=self.context)
     service_obj.id = 123
     service_obj.host = 'fake-host'
     service_obj.save()
Ejemplo n.º 2
0
 def save(self):
     updates = self.obj_get_changes()
     updates.pop('id', None)
     db_service = db.service_update(self._context, self.id, updates)
     self._from_db_object(self._context, self, db_service)
Ejemplo n.º 3
0
 def save(self):
     updates = self.obj_get_changes()
     updates.pop('id', None)
     db_service = db.service_update(self._context, self.id, updates)
     self._from_db_object(self._context, self, db_service)