#NEWLINE# def test_simulate_policy_trace( self ) : #NEWLINE# #INDENT# policy_name = 'classification' #NEWLINE# action_name = 'action' #NEWLINE# sequence = 'q(1)' #NEWLINE# query = 'error(x)' #NEWLINE# arglist = [ policy_name , query , sequence , action_name , '--trace' ] #NEWLINE# verifylist = [ ( 'policy' , policy_name ) , ( 'action_policy' , action_name ) , ( 'sequence' , sequence ) , ( 'query' , query ) , ( 'trace' , True ) ] #NEWLINE# response = { #NEWLINE# #INDENT# 'result' : [ 'error(1)' , 'error(2)' ] , #NEWLINE# 'trace' : 'Call' , #NEWLINE# #UNINDENT# } #NEWLINE# lister = mock . Mock ( return_value = response ) #NEWLINE# self . app . client_manager . congressclient . execute_policy_action = lister #NEWLINE# cmd = policy . SimulatePolicy ( self . app , self . namespace ) #NEWLINE# parsed_args = self . check_parser ( cmd , arglist , verifylist ) #NEWLINE# cmd . take_action ( parsed_args ) #NEWLINE# body = { #NEWLINE# #INDENT# 'action_policy' : action_name , #NEWLINE# 'sequence' : sequence , #NEWLINE# 'query' : query , #NEWLINE# #UNINDENT# } #NEWLINE# lister . assert_called_with ( policy_name = policy_name , action = 'simulate' , trace = True , delta = False , body = body )