moto/tests/test_sns/test_server.py
Adam Gilman 2ad0f2fc1c SNS create_topic should only accept valid characters (#1329)
* SNS create_topic should only accept valid characters

Closes #1328

* Fix flake8 errors

* Updated regex to match full TopicName constraints

Fixed test_server as it contained invalid TopicNames’ per constraints

* fix error message for invalid topic name
2017-11-13 18:27:11 +00:00

25 lines
702 B
Python

from __future__ import unicode_literals
import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
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")
topic_data.should.contain(
"<TopicArn>arn:aws:sns:us-east-1:123456789012:testtopic</TopicArn>")
topics_data = test_client.action_data("ListTopics")
topics_data.should.contain("ListTopicsResult")
topic_data.should.contain(
"<TopicArn>arn:aws:sns:us-east-1:123456789012:testtopic</TopicArn>")