1+ import urllib .parse
2+
13import responses
24from parameterized import parameterized
35from responses import matchers
3840 "skips" : 0 ,
3941 "userStatusChanges" : 0 ,
4042}
41- TEST_RISK_TYPE = "service.authentication.http_weak_auth.http_weak_auth_encrypted"
43+ TEST_RISK_TYPE = "service.authentication.http_weak_auth/after-slash"
44+ ESCAPED_TEST_RISK_TYPE = urllib .parse .quote (TEST_RISK_TYPE , safe = "" )
4245TEST_RISK_TYPE_JSON = {
4346 "config" : "string" ,
4447 "contextType" : "string" ,
@@ -236,14 +239,14 @@ def test_get_risk_types(self, kwargs, params):
236239
237240 @parameterized .expand (
238241 [
239- ({"risk_type" : TEST_RISK_TYPE }, TEST_RISK_TYPE ),
242+ ({"risk_type" : TEST_RISK_TYPE }, ESCAPED_TEST_RISK_TYPE ),
240243 (
241244 {"risk_type" : TEST_RISK_TYPE , "include_events" : True },
242- TEST_RISK_TYPE + "?includeEvents=True" ,
245+ ESCAPED_TEST_RISK_TYPE + "?includeEvents=True" ,
243246 ),
244247 (
245248 {"risk_type" : TEST_RISK_TYPE , "include_events" : False },
246- TEST_RISK_TYPE + "?includeEvents=False" ,
249+ ESCAPED_TEST_RISK_TYPE + "?includeEvents=False" ,
247250 ),
248251 ]
249252 )
@@ -270,7 +273,7 @@ def test_patch_risk_type(self):
270273 )
271274 self .responses .add (
272275 responses .PATCH ,
273- V2_URL + f"/risk-types/{ TEST_RISK_TYPE } " ,
276+ V2_URL + f"/risk-types/{ ESCAPED_TEST_RISK_TYPE } " ,
274277 status = 200 ,
275278 json = TEST_PATCH_RISK_TYPE_JSON ,
276279 match = [matchers .json_params_matcher (mock_patch )],
0 commit comments