def test_mock_add_STANDARDOTP_credential(self, mock_managementservices):
reply = {'statusMessage': "Success", 'requestId': 'add_otp_cred', 'status': '0000'}
# 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.addCredentialOtp.return_value = Mock()
mock_managementservices.addCredentialOtp.return_value.json.return_value = reply
response = symantec_package.lib.managementService.SymantecManagementServices.addCredentialOtp("add_otp_cred", "new_user3",
"", "STANDARD_OTP", \
"678066") # change with what's on your device
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
评论列表
文章目录