Merge pull request #1027 from iCHEF/fix_sns_should_send_json_http_message
Send JSON message to HTTP endpoint of SNS
This commit is contained in:
commit
2b76d07558
2 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
|
||||
from six.moves.urllib.parse import parse_qs
|
||||
|
||||
import boto3
|
||||
|
|
@ -56,9 +59,15 @@ def test_publish_to_sqs_in_different_region():
|
|||
@freeze_time("2013-01-01")
|
||||
@mock_sns
|
||||
def test_publish_to_http():
|
||||
responses.add(
|
||||
def callback(request):
|
||||
request.headers["Content-Type"].should.equal("application/json")
|
||||
json.loads.when.called_with(request.body).should_not.throw(Exception)
|
||||
return 200, {}, ""
|
||||
|
||||
responses.add_callback(
|
||||
method="POST",
|
||||
url="http://example.com/foobar",
|
||||
callback=callback,
|
||||
)
|
||||
|
||||
conn = boto3.client('sns', region_name='us-east-1')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue