Save the sns messages in the PlatformEndpoint

This makes it easier to test the correct sns messages are sent
This commit is contained in:
Michael van Tellingen 2016-06-02 11:02:43 +02:00
parent 4372c346d9
commit 45ce0615e1
No known key found for this signature in database
GPG Key ID: 96B67042ABC44F77

View File

@ -119,6 +119,7 @@ class PlatformEndpoint(object):
self.token = token
self.attributes = attributes
self.id = uuid.uuid4()
self.messages = OrderedDict()
@property
def arn(self):
@ -130,8 +131,9 @@ class PlatformEndpoint(object):
)
def publish(self, message):
message_id = six.text_type(uuid.uuid4())
# This is where we would actually send a message
message_id = six.text_type(uuid.uuid4())
self.messages[message_id] = message
return message_id