#NEWLINE# def test_add_listener( self ) : #NEWLINE# #INDENT# mock = Mock ( ) #NEWLINE# self . listeners . add ( 'test' , self ) #NEWLINE# iterator = self . listeners . notify ( 'test' , 'hello world' ) #NEWLINE# task . cooperate ( iterator ) . whenDone ( ) . addCallback ( ( lambda i : mock . assert_called_with ( 'test' , 'hello world' ) ) )