def test_trigger_update(self): trigger_ref = self._create_trigger() id = trigger_ref['id'] trigger_ref = db.trigger_update(self.ctxt, id, {'type': 'event'}) self.assertEqual('event', trigger_ref['type']) trigger_ref = db.trigger_get(self.ctxt, id) self.assertEqual('event', trigger_ref['type']) self.assertRaises(exception.TriggerNotFound, db.trigger_update, self.ctxt, '100', {"type": "event"})
def get_by_id(cls, context, id): db_trigger = db.trigger_get(context, id) if db_trigger: return cls._from_db_object(context, cls(), db_trigger)
def test_trigger_get(self): trigger_ref = self._create_trigger() trigger_ref = db.trigger_get(self.ctxt, trigger_ref['id']) self.assertEqual('time', trigger_ref['type'])