#NEWLINE# def test_callFindValue( self ) : #NEWLINE# #INDENT# self . _connecting_to_connected ( ) #NEWLINE# n = Node ( digest ( 'S' ) , self . addr1 [ 0 ] , self . addr1 [ 1 ] ) #NEWLINE# self . wire_protocol [ self . addr1 ] = self . con #NEWLINE# keyword = Node ( digest ( 'Keyword' ) ) #NEWLINE# self . protocol . callFindValue ( n , keyword ) #NEWLINE# self . clock . advance ( constants . PACKET_TIMEOUT ) #NEWLINE# connection . REACTOR . runUntilCurrent ( ) #NEWLINE# sent_packet = packet . Packet . from_bytes ( self . proto_mock . send_datagram . call_args_list [ 0 ] [ 0 ] [ 0 ] ) #NEWLINE# sent_message = sent_packet . payload #NEWLINE# m = message . Message ( ) #NEWLINE# m . ParseFromString ( sent_message ) #NEWLINE# self . assertTrue ( ( len ( m . messageID ) == 20 ) ) #NEWLINE# self . assertEqual ( self . protocol . sourceNode . getProto ( ) . guid , m . sender . guid ) #NEWLINE# self . assertEqual ( self . protocol . sourceNode . getProto ( ) . publicKey , m . sender . publicKey ) #NEWLINE# self . assertTrue ( ( m . command == message . FIND_VALUE ) ) #NEWLINE# self . assertEqual ( self . proto_mock . send_datagram . call_args_list [ 0 ] [ 0 ] [ 1 ] , self . addr1 ) #NEWLINE# self . assertEqual ( m . arguments [ 0 ] , keyword . id )