Update SNS get_endpoint_attributes response for Not Found endpoints (#3637)

The response returned for sns.get_endpoint_attributes was not in
sync with the actual response from boto.

Co-authored-by: Antillon, Alejandro <alejandro.antillon@f-secure.com>
This commit is contained in:
aantillonl 2021-01-31 14:29:10 +02:00 committed by GitHub
commit e9dc5edf7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 3 deletions

View file

@ -5,6 +5,7 @@ from botocore.exceptions import ClientError
from moto import mock_sns
import sure # noqa
from moto.core import ACCOUNT_ID
import pytest
@mock_sns
@ -206,6 +207,18 @@ def test_get_endpoint_attributes():
)
@mock_sns
def test_get_non_existent_endpoint_attributes():
conn = boto3.client("sns", region_name="us-east-1")
endpoint_arn = "arn:aws:sns:us-east-1:123456789012:endpoint/APNS/my-application/c1f76c42-192a-4e75-b04f-a9268ce2abf3"
with pytest.raises(conn.exceptions.NotFoundException) as excinfo:
conn.get_endpoint_attributes(EndpointArn=endpoint_arn)
error = excinfo.value.response["Error"]
error["Type"].should.equal("Sender")
error["Code"].should.equal("NotFound")
error["Message"].should.equal("Endpoint does not exist")
@mock_sns
def test_get_missing_endpoint_attributes():
conn = boto3.client("sns", region_name="us-east-1")