Merge pull request #1418 from stillwaiting/sns-do-not-duplicate-subscriptions
SNS: do not duplicate subscriptions
This commit is contained in:
commit
47ec9bcdc8
2 changed files with 27 additions and 0 deletions
|
|
@ -25,6 +25,23 @@ def test_subscribe_sms():
|
|||
)
|
||||
resp.should.contain('SubscriptionArn')
|
||||
|
||||
@mock_sns
|
||||
def test_double_subscription():
|
||||
client = boto3.client('sns', region_name='us-east-1')
|
||||
client.create_topic(Name="some-topic")
|
||||
resp = client.create_topic(Name="some-topic")
|
||||
arn = resp['TopicArn']
|
||||
|
||||
do_subscribe_sqs = lambda sqs_arn: client.subscribe(
|
||||
TopicArn=arn,
|
||||
Protocol='sqs',
|
||||
Endpoint=sqs_arn
|
||||
)
|
||||
resp1 = do_subscribe_sqs('arn:aws:sqs:elasticmq:000000000000:foo')
|
||||
resp2 = do_subscribe_sqs('arn:aws:sqs:elasticmq:000000000000:foo')
|
||||
|
||||
resp1['SubscriptionArn'].should.equal(resp2['SubscriptionArn'])
|
||||
|
||||
|
||||
@mock_sns
|
||||
def test_subscribe_bad_sms():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue