#NEWLINE# @ mock . patch . object ( keystone . api , 'keystone' ) #NEWLINE# def _test_project_get_list( self , params , expected_call , kc ) : #NEWLINE# #INDENT# request = self . mock_rest_request ( ** { #NEWLINE# #INDENT# 'GET' : dict ( ** params ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# kc . tenant_list . return_value = ( [ mock . Mock ( ** { #NEWLINE# #INDENT# 'to_dict.return_value' : { #NEWLINE# #INDENT# 'name' : 'Ni!' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) , mock . Mock ( ** { #NEWLINE# #INDENT# 'to_dict.return_value' : { #NEWLINE# #INDENT# 'name' : 'Ptang!' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) ] , False ) #NEWLINE# with mock . patch . object ( settings , 'DEBUG' , True ) : #NEWLINE# #INDENT# response = keystone . Projects ( ) . get ( request ) #NEWLINE# #UNINDENT# self . assertStatusCode ( response , 200 ) #NEWLINE# self . assertEqual ( response . json , { #NEWLINE# #INDENT# 'has_more' : False , #NEWLINE# 'items' : [ { #NEWLINE# #INDENT# 'name' : 'Ni!' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'Ptang!' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# kc . tenant_list . assert_called_once_with ( request , ** expected_call )