def test_mock_setTemporaryPasswordSMSDelivery(self, mock_managementservices):
reply = {'status': '0000', 'requestId': 'setTempPWD', 'statusMessage': 'Success', 'temporaryPassword': '998241'}
# Configure the mock to return a response with an OK status code. Also, the mock should have
# a `json()` method that returns a list of todos.
mock_managementservices.setTemporaryPasswordSMSDelivery.return_value = Mock()
mock_managementservices.setTemporaryPasswordSMSDelivery.return_value.json.return_value = reply
response = symantec_package.lib.managementService.SymantecManagementServices.setTemporaryPasswordSMSDelivery("setTempPWD",
"gabe_phone",
"12313608781",
"17879481605")
print(response.json())
# If the request is sent successfully, then I expect a response to be returned.
self.assertTrue((response.json()) == reply)
self.assertTrue((response.json()["status"] == "0000"))
pass
评论列表
文章目录