#NEWLINE# @ mock . patch . object ( utils , 'print_list' ) #NEWLINE# def test_do_event_list( self , mock_print ) : #NEWLINE# #INDENT# service = mock . Mock ( ) #NEWLINE# fields = [ 'id' , 'timestamp' , 'obj_type' , 'obj_id' , 'obj_name' , 'action' , 'status' , 'status_reason' , 'level' ] #NEWLINE# args = { #NEWLINE# #INDENT# 'sort' : 'timestamp:asc' , #NEWLINE# 'limit' : 20 , #NEWLINE# 'marker' : 'marker_id' , #NEWLINE# 'global_project' : True , #NEWLINE# 'filters' : [ 'action=NODE_DELETE' ] , #NEWLINE# 'full_id' : True , #NEWLINE# #UNINDENT# } #NEWLINE# queries = copy . deepcopy ( args ) #NEWLINE# del queries [ 'full_id' ] #NEWLINE# del queries [ 'filters' ] #NEWLINE# queries [ 'action' ] = 'NODE_DELETE' #NEWLINE# args = self . _make_args ( args ) #NEWLINE# formatters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# events = mock . Mock ( ) #NEWLINE# service . events . return_value = events #NEWLINE# sh . do_event_list ( service , args ) #NEWLINE# service . events . assert_called_once_with ( ** queries ) #NEWLINE# mock_print . assert_called_once_with ( events , fields , formatters = formatters )