'Test adding two observers for the same query.
When the event is dispatched both of the observers need to be called.'

def test_addObserverTwice(self):

    d = EventDispatcher()
    cb1 = CallbackTracker()
    cb2 = CallbackTracker()
    d.addObserver('//event/testevent', cb1.call)
    d.addObserver('//event/testevent', cb2.call)
    d.dispatch(d, '//event/testevent')
    self.assertEqual(cb1.called, 1)
    self.assertEqual(cb1.obj, d)
    self.assertEqual(cb2.called, 1)
    self.assertEqual(cb2.obj, d)
