def test_checkOtp(self, mock):
reply = {"requestId": "123", "status": "0000", "statusMessage": "Success", "credentialId": "",
"credentialType": "STANDARD_OTP", "authContext": {"params": {"Key": "authLevel.level", "Value": 1}}}
mock.SymantecUserServices.checkOtp.return_value = Mock()
mock.checkOtp.return_value.hash.return_value = reply
response = symantec_package.lib.userService.SymantecUserServices.checkOut("checkOutyou")
self.assertTrue(response.hash() != reply)
response = symantec_package.lib.userService.SymantecUserServices.checkOtp("PARAMS")
self.assertTrue((response.hash()) == reply)
self.assertTrue(response.hash()["status"] == "0000")
self.assertTrue(response.hash()['requestId'] == "123")
self.assertTrue(response.hash()['statusMessage'] == "Success")
self.assertTrue(response.hash()['credentialId'] == "")
self.assertTrue(response.hash()['credentialType'] == "STANDARD_OTP")
self.assertTrue(response.hash()['authContext']['params']['Key'] == "authLevel.level")
self.assertTrue(response.hash()['authContext']['params']['Value'] == 1)
pass
评论列表
文章目录