#NEWLINE# def test_acceptResponse( self ) : #NEWLINE# #INDENT# self . _connecting_to_connected ( ) #NEWLINE# def handle_response( resp ) : #NEWLINE# #INDENT# self . assertTrue ( resp [ 0 ] ) #NEWLINE# self . assertEqual ( resp [ 1 ] [ 0 ] , 'test' ) #NEWLINE# self . assertTrue ( ( message_id not in self . protocol . _outstanding ) ) #NEWLINE# #UNINDENT# message_id = digest ( 'msgid' ) #NEWLINE# n = Node ( digest ( 'S' ) , self . addr1 [ 0 ] , self . addr1 [ 1 ] ) #NEWLINE# d = defer . Deferred ( ) #NEWLINE# self . protocol . _outstanding [ message_id ] = ( d , self . addr1 , reactor . callLater ( 5 , handle_response ) ) #NEWLINE# self . protocol . _acceptResponse ( message_id , [ 'test' ] , handle_response ) #NEWLINE# return d . addCallback ( handle_response )