From 1068e26e66840d177a296fc9db711f9b03d25d86 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Mon, 6 Mar 2017 21:48:22 -0500 Subject: [PATCH 1/3] Bump travis to python 3.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From cdd6e476cca75e401aa778bd2e777580e757ca4a Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sat, 11 Mar 2017 20:50:24 -0500 Subject: [PATCH 2/3] If using newer dynamodb api, use version 2. --- moto/server.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/moto/server.py b/moto/server.py index fcc91ac6c..b028f62bc 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) From b2a360aaf78a42d63f4d54d34a97961bef402919 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sat, 11 Mar 2017 21:03:03 -0500 Subject: [PATCH 3/3] Remove old boto sns test in favor of boto3 test. --- tests/test_sns/test_publishing.py | 21 --------------------- 1 file changed, 21 deletions(-) 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']