'Tracing keeps track of forwarding to observers.'

def test_trace(self):

    event = dict(foo=1, bar=2, log_trace=[])
    traces = {}
    o1 = (lambda e: traces.setdefault(1, tuple(e['log_trace'])))
    o2 = (lambda e: traces.setdefault(2, tuple(e['log_trace'])))
    publisher = LogPublisher(o1, o2)
    publisher(event)
    self.assertEqual(traces[1], ((publisher, o1),))
    self.assertEqual(traces[2], ((publisher, o1), (publisher, o2)))
