'Test observer clean-up after removeObserver for XPath events.'

def test_cleanUpRemoveXPathObserver(self):

    d = EventDispatcher()
    cb = CallbackTracker()
    msg = Element((None, 'message'))
    d.addObserver('/message', cb.call)
    d.dispatch(msg)
    self.assertEqual(1, cb.called)
    d.removeObserver('/message', cb.call)
    self.assertEqual(0, len(d._xpathObservers.pop(0)))
