Merge pull request #327 from jairhenrique/sns

Add SNS method
This commit is contained in:
Steve Pulec 2015-03-06 14:35:14 -05:00
commit 0ca3b7f69d
2 changed files with 38 additions and 0 deletions

View File

@ -184,3 +184,25 @@ class SNSResponse(BaseResponse):
}
}
})
def list_endpoints_by_platform_application(self):
return json.dumps({
"ListEndpointsByPlatformApplicationResponse": {
"ListEndpointsByPlatformApplicationResult": {
"Endpoints": [
{
"Attributes": {
"Token": "TOKEN",
"Enabled": "true",
"CustomUserData": ""
},
"EndpointArn": "FAKE_ARN_ENDPOINT"
}
],
"NextToken": None
},
"ResponseMetadata": {
"RequestId": "384ac68d-3775-11df-8963-01868b7c937a",
}
}
})

View File

@ -0,0 +1,16 @@
from __future__ import unicode_literals
import boto
from moto import mock_sns
@mock_sns
def test_get_list_endpoints_by_platform_application():
conn = boto.connect_sns()
endpoint_list = conn.list_endpoints_by_platform_application(
platform_application_arn='fake_arn'
)['ListEndpointsByPlatformApplicationResponse']['ListEndpointsByPlatformApplicationResult']['Endpoints']
endpoint_list.should.have.length_of(1)
endpoint_list[0]['Attributes']['Enabled'].should.equal('true')
endpoint_list[0]['EndpointArn'].should.equal('FAKE_ARN_ENDPOINT')