#NEWLINE# def test_create_targeted_message_with_response( self ) : #NEWLINE# #INDENT# self . flags ( max_hop_count = 99 , group = 'cells' ) #NEWLINE# our_name = 'child-cell1' #NEWLINE# target_cell = 'child-cell1!api-cell' #NEWLINE# msg_runner = fakes . get_message_runner ( our_name ) #NEWLINE# method = 'fake_method' #NEWLINE# method_kwargs = dict ( arg1 = 1 , arg2 = 2 ) #NEWLINE# direction = 'up' #NEWLINE# tgt_message = messaging . _TargetedMessage ( msg_runner , self . ctxt , method , method_kwargs , direction , target_cell , need_response = True ) #NEWLINE# self . assertEqual ( self . ctxt , tgt_message . ctxt ) #NEWLINE# self . assertEqual ( method , tgt_message . method_name ) #NEWLINE# self . assertEqual ( method_kwargs , tgt_message . method_kwargs ) #NEWLINE# self . assertEqual ( direction , tgt_message . direction ) #NEWLINE# self . assertEqual ( target_cell , target_cell ) #NEWLINE# self . assertFalse ( tgt_message . fanout ) #NEWLINE# self . assertTrue ( tgt_message . need_response ) #NEWLINE# self . assertEqual ( our_name , tgt_message . routing_path ) #NEWLINE# self . assertEqual ( 1 , tgt_message . hop_count ) #NEWLINE# self . assertEqual ( 99 , tgt_message . max_hop_count ) #NEWLINE# self . assertFalse ( tgt_message . is_broadcast ) #NEWLINE# next_hop = tgt_message . _get_next_hop ( ) #NEWLINE# parent_cell = msg_runner . state_manager . get_parent_cell ( 'api-cell' ) #NEWLINE# self . assertEqual ( parent_cell , next_hop )