#NEWLINE# def test_remove_handler_by_key( self ) : #NEWLINE# #INDENT# key = self . machine . events . add_handler ( 'test_event' , self . event_handler1 ) #NEWLINE# self . advance_time_and_run ( 1 ) #NEWLINE# self . machine . events . post ( 'test_event' ) #NEWLINE# self . advance_time_and_run ( 1 ) #NEWLINE# self . assertEquals ( 1 , self . _handler1_called ) #NEWLINE# self . assertEquals ( tuple ( ) , self . _handler1_args ) #NEWLINE# self . assertEquals ( dict ( ) , self . _handler1_kwargs ) #NEWLINE# self . machine . events . remove_handler_by_key ( self ) #NEWLINE# self . machine . events . post ( 'test_event' ) #NEWLINE# self . advance_time_and_run ( 1 ) #NEWLINE# self . assertEquals ( 1 , self . _handler1_called ) #NEWLINE# self . assertEquals ( tuple ( ) , self . _handler1_args ) #NEWLINE# self . assertEquals ( dict ( ) , self . _handler1_kwargs )