2014-08-27 11:17:06 -04:00
|
|
|
from __future__ import unicode_literals
|
2019-12-16 21:05:29 -05:00
|
|
|
from moto.core import ACCOUNT_ID
|
2015-08-03 22:48:15 +02:00
|
|
|
|
|
|
|
import sure # noqa
|
|
|
|
|
|
|
|
import moto.server as server
|
|
|
|
|
2019-10-31 08:44:26 -07:00
|
|
|
"""
|
2015-08-03 22:48:15 +02:00
|
|
|
Test the different server responses
|
2019-10-31 08:44:26 -07:00
|
|
|
"""
|
2015-08-03 22:48:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_sns_server_get():
|
|
|
|
backend = server.create_backend_app("sns")
|
|
|
|
test_client = backend.test_client()
|
|
|
|
|
2017-11-13 18:27:11 +00:00
|
|
|
topic_data = test_client.action_data("CreateTopic", Name="testtopic")
|
2015-08-20 11:12:25 -04:00
|
|
|
topic_data.should.contain("CreateTopicResult")
|
2017-02-23 21:37:43 -05:00
|
|
|
topic_data.should.contain(
|
2019-12-15 19:22:26 -05:00
|
|
|
"<TopicArn>arn:aws:sns:us-east-1:{}:testtopic</TopicArn>".format(ACCOUNT_ID)
|
2019-10-31 08:44:26 -07:00
|
|
|
)
|
2015-08-03 22:48:15 +02:00
|
|
|
|
2015-08-20 11:12:25 -04:00
|
|
|
topics_data = test_client.action_data("ListTopics")
|
|
|
|
topics_data.should.contain("ListTopicsResult")
|
2017-02-23 21:37:43 -05:00
|
|
|
topic_data.should.contain(
|
2019-12-15 19:22:26 -05:00
|
|
|
"<TopicArn>arn:aws:sns:us-east-1:{}:testtopic</TopicArn>".format(ACCOUNT_ID)
|
2019-10-31 08:44:26 -07:00
|
|
|
)
|