#NEWLINE# @ mock . patch . object ( utils , 'print_list' ) #NEWLINE# def test_do_cluster_node_list( self , mock_print ) : #NEWLINE# #INDENT# service = mock . Mock ( ) #NEWLINE# args = { #NEWLINE# #INDENT# 'id' : 'cluster_id' , #NEWLINE# 'limit' : 20 , #NEWLINE# 'marker' : 'marker_id' , #NEWLINE# 'filters' : [ 'status=ACTIVE' ] , #NEWLINE# #UNINDENT# } #NEWLINE# queries = copy . deepcopy ( args ) #NEWLINE# queries [ 'cluster_id' ] = args [ 'id' ] #NEWLINE# del queries [ 'id' ] #NEWLINE# del queries [ 'filters' ] #NEWLINE# queries [ 'status' ] = 'ACTIVE' #NEWLINE# args = self . _make_args ( args ) #NEWLINE# args . full_id = True #NEWLINE# nodes = mock . Mock ( ) #NEWLINE# service . nodes . return_value = nodes #NEWLINE# formatters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# fields = [ 'id' , 'name' , 'index' , 'status' , 'physical_id' , 'created_at' ] #NEWLINE# sh . do_cluster_node_list ( service , args ) #NEWLINE# service . nodes . assert_called_once_with ( ** queries ) #NEWLINE# mock_print . assert_called_once_with ( nodes , fields , formatters = formatters , sortby_index = 5 )