#NEWLINE# @ mock . patch . object ( utils , 'print_list' ) #NEWLINE# def test_do_node_list( self , mock_print ) : #NEWLINE# #INDENT# service = mock . Mock ( ) #NEWLINE# fields = [ 'id' , 'name' , 'index' , 'status' , 'cluster_id' , 'physical_id' , 'profile_name' , 'created_at' , 'updated_at' ] #NEWLINE# args = { #NEWLINE# #INDENT# 'cluster' : 'cluster1' , #NEWLINE# 'sort' : 'name:asc' , #NEWLINE# 'limit' : 20 , #NEWLINE# 'marker' : 'marker_id' , #NEWLINE# 'global_project' : True , #NEWLINE# 'filters' : [ 'status=active' ] , #NEWLINE# 'full_id' : True , #NEWLINE# #UNINDENT# } #NEWLINE# queries = { #NEWLINE# #INDENT# 'cluster_id' : 'cluster1' , #NEWLINE# 'sort' : 'name:asc' , #NEWLINE# 'limit' : 20 , #NEWLINE# 'marker' : 'marker_id' , #NEWLINE# 'global_project' : True , #NEWLINE# 'status' : 'active' , #NEWLINE# #UNINDENT# } #NEWLINE# args = self . _make_args ( args ) #NEWLINE# nodes = mock . Mock ( ) #NEWLINE# service . nodes . return_value = nodes #NEWLINE# formatters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# sh . do_node_list ( service , args ) #NEWLINE# mock_print . assert_called_once_with ( nodes , fields , formatters = formatters , sortby_index = None ) #NEWLINE# service . nodes . assert_called_once_with ( ** queries )