#NEWLINE# def test_cleanUpOnetimeEventObserver( self ) : #NEWLINE# #INDENT# '\n        Test observer clean-up after onetime named events.\n        ' #NEWLINE# d = EventDispatcher ( ) #NEWLINE# cb = CallbackTracker ( ) #NEWLINE# d . addOnetimeObserver ( '//event/test' , self . call ) #NEWLINE# d . dispatch ( None , '//event/test' ) #NEWLINE# self . assertEqual ( 1 , cb . called ) #NEWLINE# self . assertEqual ( 0 , len ( d . _eventObservers . pop ( 0 ) ) )