#NEWLINE# def test_self_targeted_message( self ) : #NEWLINE# #INDENT# target_cell = 'api-cell' #NEWLINE# method = 'our_fake_method' #NEWLINE# method_kwargs = dict ( arg1 = 1 , arg2 = 2 ) #NEWLINE# direction = 'down' #NEWLINE# call_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# def our_fake_method( message , **kwargs ) : #NEWLINE# #INDENT# call_info [ 'context' ] = message . ctxt #NEWLINE# call_info [ 'routing_path' ] = message . routing_path #NEWLINE# call_info [ 'kwargs' ] = kwargs #NEWLINE# #UNINDENT# fakes . stub_tgt_method ( self , 'api-cell' , 'our_fake_method' , our_fake_method ) #NEWLINE# tgt_message = messaging . _TargetedMessage ( self . msg_runner , self . ctxt , method , method_kwargs , direction , target_cell ) #NEWLINE# tgt_message . process ( ) #NEWLINE# self . assertEqual ( self . ctxt , call_info [ 'context' ] ) #NEWLINE# self . assertEqual ( method_kwargs , call_info [ 'kwargs' ] ) #NEWLINE# self . assertEqual ( target_cell , call_info [ 'routing_path' ] )