diff --git a/.travis.yml b/.travis.yml index 87ee121e6..c58ed85f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: python sudo: false python: - 2.7 - - 3.3 + - 3.6 env: - TEST_SERVER_MODE=false - TEST_SERVER_MODE=true diff --git a/moto/server.py b/moto/server.py index b70bb99bd..a23580065 100644 --- a/moto/server.py +++ b/moto/server.py @@ -62,8 +62,14 @@ class DomainDispatcherApplication(object): except ValueError: region = 'us-east-1' service = 's3' - host = "{service}.{region}.amazonaws.com".format( - service=service, region=region) + if service == 'dynamodb': + dynamo_api_version = environ['HTTP_X_AMZ_TARGET'].split("_")[1].split(".")[0] + # If Newer API version, use dynamodb2 + if dynamo_api_version > "20111205": + host = "dynamodb2" + else: + host = "{service}.{region}.amazonaws.com".format( + service=service, region=region) with self.lock: backend = self.get_backend_for_host(host) diff --git a/tests/test_sns/test_publishing.py b/tests/test_sns/test_publishing.py index 51042675f..dd75ff4be 100644 --- a/tests/test_sns/test_publishing.py +++ b/tests/test_sns/test_publishing.py @@ -51,24 +51,3 @@ def test_publish_to_sqs_in_different_region(): queue = sqs_conn.get_queue("test-queue") message = queue.read(1) message.get_body().should.equal('my message') - - -@freeze_time("2013-01-01") -@mock_sns_deprecated -def test_publish_to_http(): - responses.add( - method="POST", - url="http://example.com/foobar", - ) - - conn = boto.connect_sns() - conn.create_topic("some-topic") - topics_json = conn.get_all_topics() - topic_arn = topics_json["ListTopicsResponse"][ - "ListTopicsResult"]["Topics"][0]['TopicArn'] - - conn.subscribe(topic_arn, "http", "http://example.com/foobar") - - response = conn.publish( - topic=topic_arn, message="my message", subject="my subject") - message_id = response['PublishResponse']['PublishResult']['MessageId']