def test_trigger(self): event = Event() result = {} @event.connect def test1(data): result['x'] = data event.trigger({1: 2}) self.assertDictEqual(result, {'x': {1: 2}})
def test_multiple_triggers(self): event = Event() result = {} @event.connect def test1(data): result['x'] = data @event.connect def test2(a): result['y'] = a event.trigger({1: 2}) self.assertDictEqual(result, {'x': {1: 2}, 'y': {1: 2}})