def test_DummyQueue_is_FIFO(self): ev1 = event.Event('ev1', {}) ev2 = event.Event('ev2', {}) qq = hub.DummyQueue('send') qq.put_event(ev1) qq.put_event(ev2) got = qq.get_event() assert got == ev1 got = qq.get_event() assert got == ev2
def test_unicode(self): bob = dict(name='bob', email='*****@*****.**') evid = 'user.account.created' ev = event.Event(evid, bob) got = unicode(ev) want = "<Event event_id user.account.created, " +\ "datakeys ['email', 'name']>" assert testing.checker.check_output(want, got, 0)
def event_factory(self, event_id, data={}): return event.Event(event_id, data)
def test_Action_conforms_to_interface(self): ee = event.Event('e') aa = action.Action(event=ee, row={}) assert interface.IAction in providedBy(aa)
def test_action_type(self): ee = event.Event('e') aa = action.DummyEmailAction(event=ee, row={}) assert aa.action_type == 'DummyEmailAction'
def test_handle(self): ee = event.Event('e') aa = action.DummyEmailAction(event=ee, row={}) # Just check the method is there assert aa.handle
def test_name_attr(self): bob = dict(name='bob', email='*****@*****.**') evid = 'user.account.created' ev = event.Event(evid, bob) assert ev.event_id == evid