moto/tests/test_sns/test_server.py

27 lines
755 B
Python
Raw Normal View History

from moto.core import ACCOUNT_ID
2021-10-18 19:44:29 +00:00
import sure # noqa # pylint: disable=unused-import
import moto.server as server
2019-10-31 15:44:26 +00:00
"""
Test the different server responses
2019-10-31 15:44:26 +00:00
"""
def test_sns_server_get():
backend = server.create_backend_app("sns")
test_client = backend.test_client()
topic_data = test_client.action_data("CreateTopic", Name="testtopic")
topic_data.should.contain("CreateTopicResult")
2017-02-24 02:37:43 +00:00
topic_data.should.contain(
"<TopicArn>arn:aws:sns:us-east-1:{}:testtopic</TopicArn>".format(ACCOUNT_ID)
2019-10-31 15:44:26 +00:00
)
topics_data = test_client.action_data("ListTopics")
topics_data.should.contain("ListTopicsResult")
2017-02-24 02:37:43 +00:00
topic_data.should.contain(
"<TopicArn>arn:aws:sns:us-east-1:{}:testtopic</TopicArn>".format(ACCOUNT_ID)
2019-10-31 15:44:26 +00:00
)