2023-08-10 14:07:41 -04:00
|
|
|
"""Test the different server responses."""
|
2022-08-13 09:49:43 +00:00
|
|
|
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
|
2015-08-03 22:48:15 +02:00
|
|
|
import moto.server as server
|
|
|
|
|
|
|
|
|
|
|
|
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")
|
2023-08-10 14:07:41 -04:00
|
|
|
assert "CreateTopicResult" in topic_data
|
|
|
|
assert (
|
2022-11-17 21:41:08 -01:00
|
|
|
f"<TopicArn>arn:aws:sns:us-east-1:{ACCOUNT_ID}:testtopic</TopicArn>"
|
2023-08-10 14:07:41 -04:00
|
|
|
) in topic_data
|
2015-08-03 22:48:15 +02:00
|
|
|
|
2015-08-20 11:12:25 -04:00
|
|
|
topics_data = test_client.action_data("ListTopics")
|
2023-08-10 14:07:41 -04:00
|
|
|
assert "ListTopicsResult" in topics_data
|
|
|
|
assert (
|
2022-11-17 21:41:08 -01:00
|
|
|
f"<TopicArn>arn:aws:sns:us-east-1:{ACCOUNT_ID}:testtopic</TopicArn>"
|
2023-08-10 14:07:41 -04:00
|
|
|
) in topics_data
|