Merge branch 'master' into dashboard

This commit is contained in:
Steve Pulec 2017-03-11 22:45:45 -05:00
commit abe0460dc7
3 changed files with 9 additions and 24 deletions

View File

@ -2,7 +2,7 @@ language: python
sudo: false
python:
- 2.7
- 3.3
- 3.6
env:
- TEST_SERVER_MODE=false
- TEST_SERVER_MODE=true

View File

@ -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)

View File

@ -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']