#NEWLINE# def test_cleanUpOnetimeXPathObserver( self ) : #NEWLINE# #INDENT# '\n        Test observer clean-up after onetime XPath events.\n        ' #NEWLINE# d = EventDispatcher ( ) #NEWLINE# cb = CallbackTracker ( ) #NEWLINE# msg = Element ( ( None , 'message' ) ) #NEWLINE# d . addOnetimeObserver ( '/message' , cb . call ) #NEWLINE# d . dispatch ( d ) #NEWLINE# self . assertEqual ( 1 , cb . called ) #NEWLINE# self . assertEqual ( 0 , len ( d . _xpathObservers . pop ( 0 ) ) )