mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 18:23:01 -04:00
more tests
This commit is contained in:
@@ -7,20 +7,21 @@ from app.clients.pinpoint.aws_pinpoint import AwsPinpointClient
|
|||||||
|
|
||||||
|
|
||||||
def test_validate_phone_number_success():
|
def test_validate_phone_number_success():
|
||||||
|
phone = "+1234567890"
|
||||||
mock_response = {
|
mock_response = {
|
||||||
"NumberValidateResponse": {
|
"NumberValidateResponse": {
|
||||||
"PhoneType": "MOBILE",
|
"PhoneType": "MOBILE",
|
||||||
"CleansedPhoneNumberE164": "+1234567890",
|
"CleansedPhoneNumberE164": phone,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client_instance = AwsPinpointClient()
|
client_instance = AwsPinpointClient()
|
||||||
client_instance._client = MagicMock()
|
client_instance._client = MagicMock()
|
||||||
client_instance._client.phone_number_validate.return_value = mock_response
|
client_instance._client.phone_number_validate.return_value = mock_response
|
||||||
|
|
||||||
result = client_instance.validate_phone_number("US", "+1234567890")
|
result = client_instance.validate_phone_number("US", phone)
|
||||||
assert result is not None
|
assert result is not None
|
||||||
client_instance._client.phone_number_validate.assert_called_once_with(
|
client_instance._client.phone_number_validate.assert_called_once_with(
|
||||||
NumberValidateRequest={"IsoCountryCode": "US", "PhoneNumber": "+1234567890"}
|
NumberValidateRequest={"IsoCountryCode": "US", "PhoneNumber": phone}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user