Beispiel #1
0
 def test_get_by_id(self):
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'action_event_get_by_id')
     db.action_event_get_by_id(ctxt, 'fake-id').AndReturn(fake_event)
     self.mox.ReplayAll()
     event = instance_action.InstanceActionEvent.get_by_id(ctxt, 'fake-id')
     self.assertEqual(fake_event['id'], event.id)
 def test_get_by_id(self):
     ctxt = context.get_admin_context()
     self.mox.StubOutWithMock(db, 'action_event_get_by_id')
     db.action_event_get_by_id(ctxt, 'fake-id').AndReturn(fake_event)
     self.mox.ReplayAll()
     event = instance_action.InstanceActionEvent.get_by_id(ctxt, 'fake-id')
     self.assertEqual(fake_event['id'], event.id)
 def get_by_id(cls, context, action_id, event_id):
     db_event = db.action_event_get_by_id(context, action_id, event_id)
     return cls._from_db_object(context, cls(), db_event)
Beispiel #4
0
 def get_by_id(cls, context, action_id, event_id):
     db_event = db.action_event_get_by_id(context, action_id, event_id)
     return cls._from_db_object(context, cls(), db_event)