@@ -31,12 +31,12 @@ def test_save_schema(self):
3131 )
3232
3333 # Test failed save_schema
34- with patch ("requests .post" ) as mock_post :
34+ with patch ("httpx .post" ) as mock_post :
3535 mock_post .return_value .ok = False
3636 self .assertRaises (AuthException , client .mgmt .fga .save_schema , "" )
3737
3838 # Test success flow
39- with patch ("requests .post" ) as mock_post :
39+ with patch ("httpx .post" ) as mock_post :
4040 mock_post .return_value .ok = True
4141 self .assertIsNone (client .mgmt .fga .save_schema ("model AuthZ 1.0" ))
4242 mock_post .assert_called_with (
@@ -48,7 +48,7 @@ def test_save_schema(self):
4848 },
4949 params = None ,
5050 json = {"dsl" : "model AuthZ 1.0" },
51- allow_redirects = False ,
51+ follow_redirects = False ,
5252 verify = True ,
5353 timeout = DEFAULT_TIMEOUT_SECONDS ,
5454 )
@@ -62,12 +62,12 @@ def test_create_relations(self):
6262 )
6363
6464 # Test failed create_relations
65- with patch ("requests .post" ) as mock_post :
65+ with patch ("httpx .post" ) as mock_post :
6666 mock_post .return_value .ok = False
6767 self .assertRaises (AuthException , client .mgmt .fga .create_relations , [])
6868
6969 # Test success flow
70- with patch ("requests .post" ) as mock_post :
70+ with patch ("httpx .post" ) as mock_post :
7171 mock_post .return_value .ok = True
7272 self .assertIsNone (
7373 client .mgmt .fga .create_relations (
@@ -101,7 +101,7 @@ def test_create_relations(self):
101101 }
102102 ]
103103 },
104- allow_redirects = False ,
104+ follow_redirects = False ,
105105 verify = True ,
106106 timeout = DEFAULT_TIMEOUT_SECONDS ,
107107 )
@@ -115,12 +115,12 @@ def test_delete_relations(self):
115115 )
116116
117117 # Test failed delete_relations
118- with patch ("requests .post" ) as mock_post :
118+ with patch ("httpx .post" ) as mock_post :
119119 mock_post .return_value .ok = False
120120 self .assertRaises (AuthException , client .mgmt .fga .delete_relations , [])
121121
122122 # Test success flow
123- with patch ("requests .post" ) as mock_post :
123+ with patch ("httpx .post" ) as mock_post :
124124 mock_post .return_value .ok = True
125125 self .assertIsNone (
126126 client .mgmt .fga .delete_relations (
@@ -154,7 +154,7 @@ def test_delete_relations(self):
154154 }
155155 ]
156156 },
157- allow_redirects = False ,
157+ follow_redirects = False ,
158158 verify = True ,
159159 timeout = DEFAULT_TIMEOUT_SECONDS ,
160160 )
@@ -168,12 +168,12 @@ def test_check(self):
168168 )
169169
170170 # Test failed has_relations
171- with patch ("requests .post" ) as mock_post :
171+ with patch ("httpx .post" ) as mock_post :
172172 mock_post .return_value .ok = False
173173 self .assertRaises (AuthException , client .mgmt .fga .check , [])
174174
175175 # Test success flow
176- with patch ("requests .post" ) as mock_post :
176+ with patch ("httpx .post" ) as mock_post :
177177 mock_post .return_value .ok = True
178178 self .assertIsNotNone (
179179 client .mgmt .fga .check (
@@ -207,7 +207,7 @@ def test_check(self):
207207 }
208208 ]
209209 },
210- allow_redirects = False ,
210+ follow_redirects = False ,
211211 verify = True ,
212212 timeout = DEFAULT_TIMEOUT_SECONDS ,
213213 )
@@ -225,7 +225,7 @@ def test_load_resources_details_success(self):
225225 {"resourceId" : "r2" , "resourceType" : "type2" , "displayName" : "Name2" },
226226 ]
227227 }
228- with patch ("requests .post" ) as mock_post :
228+ with patch ("httpx .post" ) as mock_post :
229229 mock_post .return_value .ok = True
230230 mock_post .return_value .json .return_value = response_body
231231 ids = [
@@ -243,7 +243,7 @@ def test_load_resources_details_success(self):
243243 },
244244 params = None ,
245245 json = {"resourceIdentifiers" : ids },
246- allow_redirects = False ,
246+ follow_redirects = False ,
247247 verify = True ,
248248 timeout = DEFAULT_TIMEOUT_SECONDS ,
249249 )
@@ -255,7 +255,7 @@ def test_load_resources_details_error(self):
255255 False ,
256256 self .dummy_management_key ,
257257 )
258- with patch ("requests .post" ) as mock_post :
258+ with patch ("httpx .post" ) as mock_post :
259259 mock_post .return_value .ok = False
260260 ids = [{"resourceId" : "r1" , "resourceType" : "type1" }]
261261 self .assertRaises (
@@ -274,7 +274,7 @@ def test_save_resources_details_success(self):
274274 details = [
275275 {"resourceId" : "r1" , "resourceType" : "type1" , "displayName" : "Name1" }
276276 ]
277- with patch ("requests .post" ) as mock_post :
277+ with patch ("httpx .post" ) as mock_post :
278278 mock_post .return_value .ok = True
279279 client .mgmt .fga .save_resources_details (details )
280280 mock_post .assert_called_with (
@@ -286,7 +286,7 @@ def test_save_resources_details_success(self):
286286 },
287287 params = None ,
288288 json = {"resourcesDetails" : details },
289- allow_redirects = False ,
289+ follow_redirects = False ,
290290 verify = True ,
291291 timeout = DEFAULT_TIMEOUT_SECONDS ,
292292 )
@@ -301,7 +301,7 @@ def test_save_resources_details_error(self):
301301 details = [
302302 {"resourceId" : "r1" , "resourceType" : "type1" , "displayName" : "Name1" }
303303 ]
304- with patch ("requests .post" ) as mock_post :
304+ with patch ("httpx .post" ) as mock_post :
305305 mock_post .return_value .ok = False
306306 self .assertRaises (
307307 AuthException ,
0 commit comments