'Test observer clean-up after onetime named events.'

def test_cleanUpOnetimeEventObserver(self):

    d = EventDispatcher()
    cb = CallbackTracker()
    d.addOnetimeObserver('//event/test', cb.call)
    d.dispatch(None, '//event/test')
    self.assertEqual(1, cb.called)
    self.assertEqual(0, len(d._eventObservers.pop(0)))
