def test_poll_in_Push(self, mock):
reply = {"requestId": "ac123", "status": "6040", "statusMessage": "Mobile push request sent",
"pushDetail": {"pushCredentialId": "133709001", "pushSent": True},
"transactionId": "RealTransactionId",
"authContext": {"params": {"Key": "authLevel.level", "Value": 10}}}
mock.SymantecServices.authenticateUserWithPushThenPolling.return_value = Mock()
mock.authenticateUserWithPushThenPolling.return_value.hash.return_value = reply
response = symantec_package.lib.allServices.SymantecServices.authenticateUserWithNothing()
self.assertTrue(response.hash() != reply)
response = symantec_package.lib.allServices.SymantecServices.authenticateUserWithPushThenPolling("Parameters Here!")
self.assertTrue((response.hash()) == reply)
self.assertTrue(response.hash()["status"] == "6040")
self.assertTrue(response.hash()['requestId'] == "ac123")
self.assertTrue(response.hash()['statusMessage'] == "Mobile push request sent")
self.assertTrue(response.hash()["pushDetail"]['pushCredentialId'] == "133709001")
self.assertTrue(response.hash()["pushDetail"]['pushSent'] is True)
self.assertTrue(response.hash()['transactionId'] == "RealTransactionId")
self.assertTrue(response.hash()['authContext']['params']['Key'] == "authLevel.level")
self.assertTrue(response.hash()['authContext']['params']['Value'] == 10)
pass
评论列表
文章目录