#NEWLINE# @ mock . patch . object ( utils , 'print_list' ) #NEWLINE# def test_do_action_list( self , mock_print ) : #NEWLINE# #INDENT# service = mock . Mock ( ) #NEWLINE# fields = [ 'id' , 'name' , 'action' , 'status' , 'target' , 'depends_on' , 'depended_by' , 'created_at' ] #NEWLINE# args = { #NEWLINE# #INDENT# 'sort' : 'status' , #NEWLINE# 'limit' : 20 , #NEWLINE# 'marker' : 'marker_id' , #NEWLINE# #UNINDENT# } #NEWLINE# queries = copy . deepcopy ( args ) #NEWLINE# args = self . _make_args ( args ) #NEWLINE# args . filters = [ 'status=ACTIVE' ] #NEWLINE# queries [ 'status' ] = 'ACTIVE' #NEWLINE# actions = mock . Mock ( ) #NEWLINE# service . actions . return_value = actions #NEWLINE# formatters = { #NEWLINE# #INDENT# 'depends_on' : mock . ANY , #NEWLINE# 'depended_by' : mock . ANY , #NEWLINE# #UNINDENT# } #NEWLINE# args . full_id = True #NEWLINE# sortby_index = None #NEWLINE# sh . do_action_list ( service , args ) #NEWLINE# service . actions . assert_called_once_with ( ** queries ) #NEWLINE# mock_print . assert_called_once_with ( actions , fields , formatters = formatters , sortby_index = sortby_index )