@@ -21,13 +21,35 @@ def test_response_none(self):
2121 def test_response_empty (self ):
2222 self .assertEqual (CoreProcessResponse (response (body = b'' )).call (), {})
2323
24- def test_response_authenticate (self ):
24+ def test_response_authenticate_allow (self ):
2525 self .assertEqual (
2626 CoreProcessResponse (
2727 response (body = b'{"action":"allow","user_id":"12345"}' )).call (),
2828 {"action" : "allow" , "user_id" : "12345" }
2929 )
3030
31+ def test_response_authenticate_allow_with_props (self ):
32+ self .assertEqual (
33+ CoreProcessResponse (
34+ response (body = b'{"action":"allow","user_id":"12345","internal":{}}' )).call (),
35+ {"action" : "allow" , "user_id" : "12345" , "internal" : {}}
36+ )
37+
38+ def test_response_authenticate_deny_without_rp (self ):
39+ self .assertEqual (
40+ CoreProcessResponse (
41+ response (body = b'{"action":"deny","user_id":"1","device_token":"abc"}' )).call (),
42+ {"action" : "deny" , "user_id" : "1" , "device_token" : "abc" }
43+ )
44+
45+ def test_response_authenticate_deny_with_rp (self ):
46+ self .assertEqual (
47+ CoreProcessResponse (
48+ response (body = b'{"action":"deny","user_id":"1","device_token":"abc","risk_policy":{"id":"123","revision_id":"abc","name":"def","type":"bot"}}' )).call (),
49+ {"action" : "deny" , "user_id" : "1" , "device_token" : "abc" , "risk_policy" : {
50+ "id" : "123" , "revision_id" : "abc" , "name" : "def" , "type" : "bot" }}
51+ )
52+
3153 def test_verify_200_299 (self ):
3254 for status_code in range (200 , 299 ):
3355 self .assertEqual (
0 commit comments