#NEWLINE# def test_targeted_message( self ) : #NEWLINE# #INDENT# self . flags ( max_hop_count = 99 , group = 'cells' ) #NEWLINE# target_cell = 'api-cell!child-cell2!grandchild-cell1' #NEWLINE# method = 'fake_method' #NEWLINE# method_kwargs = dict ( arg1 = 1 , arg2 = 2 ) #NEWLINE# direction = 'down' #NEWLINE# tgt_message = messaging . _TargetedMessage ( self . msg_runner , self . ctxt , method , method_kwargs , direction , target_cell ) #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 . assertFalse ( tgt_message . need_response ) #NEWLINE# self . assertEqual ( method . 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# child_cell = self . state_manager . get_child_cell ( 'child-cell2' ) #NEWLINE# self . assertEqual ( child_cell , next_hop )