@@ -93,7 +93,7 @@ class TestAccessPolicies(TestCase):
9393 def setUp (self ):
9494 self .arch = Archivist ("url" , auth = "authauthauth" )
9595
96- @mock .patch ("requests.post" )
96+ @mock .patch ("requests.Session. post" )
9797 def test_access_policies_create (self , mock_post ):
9898 """
9999 Test access_policy creation
@@ -125,7 +125,7 @@ def test_access_policies_create(self, mock_post):
125125 msg = "CREATE method called incorrectly" ,
126126 )
127127
128- @mock .patch ("requests.get" )
128+ @mock .patch ("requests.Session. get" )
129129 def test_access_policies_read (self , mock_get ):
130130 """
131131 Test access_policy reading
@@ -149,7 +149,7 @@ def test_access_policies_read(self, mock_get):
149149 msg = "GET method called incorrectly" ,
150150 )
151151
152- @mock .patch ("requests.delete" )
152+ @mock .patch ("requests.Session. delete" )
153153 def test_access_policies_delete (self , mock_delete ):
154154 """
155155 Test access_policy deleting
@@ -173,7 +173,7 @@ def test_access_policies_delete(self, mock_delete):
173173 msg = "DELETE method called incorrectly" ,
174174 )
175175
176- @mock .patch ("requests.patch" )
176+ @mock .patch ("requests.Session. patch" )
177177 def test_access_policies_update (self , mock_patch ):
178178 """
179179 Test access_policy deleting
@@ -201,7 +201,7 @@ def test_access_policies_update(self, mock_patch):
201201 msg = "PATCH method called incorrectly" ,
202202 )
203203
204- @mock .patch ("requests.get" )
204+ @mock .patch ("requests.Session. get" )
205205 def test_access_policies_read_with_error (self , mock_get ):
206206 """
207207 Test read method with error
@@ -210,7 +210,7 @@ def test_access_policies_read_with_error(self, mock_get):
210210 with self .assertRaises (ArchivistBadRequestError ):
211211 resp = self .arch .access_policies .read (IDENTITY )
212212
213- @mock .patch ("requests.get" )
213+ @mock .patch ("requests.Session. get" )
214214 def test_access_policies_count (self , mock_get ):
215215 """
216216 Test access_policy counting
@@ -246,7 +246,7 @@ def test_access_policies_count(self, mock_get):
246246 msg = "Incorrect count" ,
247247 )
248248
249- @mock .patch ("requests.get" )
249+ @mock .patch ("requests.Session. get" )
250250 def test_access_policies_count_by_name (self , mock_get ):
251251 """
252252 Test access_policy counting
@@ -285,7 +285,7 @@ def test_access_policies_count_by_name(self, mock_get):
285285 msg = "GET method called incorrectly" ,
286286 )
287287
288- @mock .patch ("requests.get" )
288+ @mock .patch ("requests.Session. get" )
289289 def test_access_policies_list (self , mock_get ):
290290 """
291291 Test access_policy listing
@@ -327,7 +327,7 @@ def test_access_policies_list(self, mock_get):
327327 msg = "GET method called incorrectly" ,
328328 )
329329
330- @mock .patch ("requests.get" )
330+ @mock .patch ("requests.Session. get" )
331331 def test_access_policies_list_by_name (self , mock_get ):
332332 """
333333 Test access_policy listing
@@ -379,7 +379,7 @@ def test_access_policies_list_by_name(self, mock_get):
379379 msg = "GET method called incorrectly" ,
380380 )
381381
382- @mock .patch ("requests.get" )
382+ @mock .patch ("requests.Session. get" )
383383 def test_access_policies_count_matching_access_policies (self , mock_get ):
384384 """
385385 Test access_policy counting
@@ -420,7 +420,7 @@ def test_access_policies_count_matching_access_policies(self, mock_get):
420420 msg = "Incorrect count" ,
421421 )
422422
423- @mock .patch ("requests.get" )
423+ @mock .patch ("requests.Session. get" )
424424 def test_access_policies_list_matching_access_policies (self , mock_get ):
425425 """
426426 Test access_policy counting
@@ -467,7 +467,7 @@ def test_access_policies_list_matching_access_policies(self, mock_get):
467467 msg = "GET method called incorrectly" ,
468468 )
469469
470- @mock .patch ("requests.get" )
470+ @mock .patch ("requests.Session. get" )
471471 def test_access_policies_count_matching_assets (self , mock_get ):
472472 """
473473 Test access_policy counting
@@ -508,7 +508,7 @@ def test_access_policies_count_matching_assets(self, mock_get):
508508 msg = "Incorrect count" ,
509509 )
510510
511- @mock .patch ("requests.get" )
511+ @mock .patch ("requests.Session. get" )
512512 def test_access_policies_list_matching_assets (self , mock_get ):
513513 """
514514 Test access_policy counting
0 commit comments