#NEWLINE# def _test_multi_request_operations( self , http_method , tested_method , * args , **kwargs ) : #NEWLINE# #INDENT# with mock . patch . object ( odl_manager . OdlManager , '_is_tenant_created' ) as mock_is_tenant_created : #NEWLINE# #INDENT# with mock . patch ( 'requests.request' ) as mock_request : #NEWLINE# #INDENT# mock_is_tenant_created . return_value = True #NEWLINE# tested_method ( * args ) #NEWLINE# mock_request . assert_called_once_with ( http_method , ** kwargs ) #NEWLINE# mock_is_tenant_created . return_value = False #NEWLINE# mock_request . reset_mock ( ) #NEWLINE# tested_method ( * args ) #NEWLINE# mock_request . assert_any_call ( 'put' , url = URL_TENANT , headers = HEADER , data = DataMatcher ( { #NEWLINE# #INDENT# 'tenant' : { #NEWLINE# #INDENT# 'id' : TENANT_ID , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) , auth = AuthMatcher ( ) ) #NEWLINE# mock_request . assert_any_call ( http_method , ** kwargs )