def test_cleanUpOnetimeXPathObserver(self):

        d = EventDispatcher()
        cb = CallbackTracker()
        msg = Element((None, "message"))

        d.addOnetimeObserver('/message', cb.call)
        d.dispatch(msg)
        self.assertEqual(1, cb.called)
        self.assertEqual(0, len(d._xpathObservers.pop(0)))
Test observer clean-up after onetime XPath events.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/test/test_xishutil.py/EventDispatcherTest.test_cleanUpOnetimeXPathObserver