Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def event_factory(self, event_id, data={}):
     return event.Event(event_id, data)
Exemplo n.º 4
0
 def test_Action_conforms_to_interface(self):
     ee = event.Event('e')
     aa = action.Action(event=ee, row={})
     assert interface.IAction in providedBy(aa)
Exemplo n.º 5
0
 def test_action_type(self):
     ee = event.Event('e')
     aa = action.DummyEmailAction(event=ee, row={})
     assert aa.action_type == 'DummyEmailAction'
Exemplo n.º 6
0
 def test_handle(self):
     ee = event.Event('e')
     aa = action.DummyEmailAction(event=ee, row={})
     # Just check the method is there
     assert aa.handle
Exemplo n.º 7
0
 def test_name_attr(self):
     bob = dict(name='bob', email='*****@*****.**')
     evid = 'user.account.created'
     ev = event.Event(evid, bob)
     assert ev.event_id == evid