SNS Docs - do not specify default region (#4909)
This commit is contained in:
parent
86e1fe8f1c
commit
aa522b11ca
@ -1,5 +1,4 @@
|
||||
from .models import sns_backends
|
||||
from ..core.models import base_decorator
|
||||
|
||||
sns_backend = sns_backends["us-east-1"]
|
||||
mock_sns = base_decorator(sns_backends)
|
||||
|
@ -415,7 +415,8 @@ class SNSBackend(BaseBackend):
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
from moto.sns import sns_backend
|
||||
from moto.sns import sns_backends
|
||||
sns_backend = sns_backends["us-east-1"] # Use the appropriate region
|
||||
all_send_notifications = sns_backend.topics[topic_arn].sent_notifications
|
||||
|
||||
Note that, as this is an internal API, the exact format may differ per versions.
|
||||
|
@ -1,5 +1,4 @@
|
||||
from .models import sqs_backends
|
||||
from ..core.models import base_decorator
|
||||
|
||||
sqs_backend = sqs_backends["us-east-1"]
|
||||
mock_sqs = base_decorator(sqs_backends)
|
||||
|
@ -1,5 +1,4 @@
|
||||
from .models import swf_backends
|
||||
from ..core.models import base_decorator
|
||||
|
||||
swf_backend = swf_backends["us-east-1"]
|
||||
mock_swf = base_decorator(swf_backends)
|
||||
|
@ -11,7 +11,7 @@ import pytest
|
||||
from moto import mock_sns, mock_sqs, settings
|
||||
from moto.core import ACCOUNT_ID
|
||||
from moto.core.models import responses_mock
|
||||
from moto.sns import sns_backend
|
||||
from moto.sns import sns_backends
|
||||
|
||||
MESSAGE_FROM_SQS_TEMPLATE = (
|
||||
'{\n "Message": "%s",\n "MessageId": "%s",\n "Signature": "EXAMPLElDMXvB8r9R83tGoNn0ecwd5UjllzsvSvbItzfaMpN2nk5HVSw7XnOn/49IkxDKz8YrlH2qJXj2iZB0Zo2O71c4qQk1fMUDi3LGpij7RCW7AW9vYYsSqIKRnFS94ilu7NFhUzLiieYr4BKHpdTmdD6c0esKEYBpabxDSc=",\n "SignatureVersion": "1",\n "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem",\n "Subject": "my subject",\n "Timestamp": "2015-01-01T12:00:00.000Z",\n "TopicArn": "arn:aws:sns:%s:'
|
||||
@ -289,6 +289,7 @@ def test_publish_sms():
|
||||
|
||||
result.should.contain("MessageId")
|
||||
if not settings.TEST_SERVER_MODE:
|
||||
sns_backend = sns_backends["us-east-1"]
|
||||
sns_backend.sms_messages.should.have.key(result["MessageId"]).being.equal(
|
||||
("+15551234567", "my message")
|
||||
)
|
||||
@ -420,6 +421,7 @@ def test_publish_to_http():
|
||||
conn.publish(TopicArn=topic_arn, Message="my message", Subject="my subject")
|
||||
|
||||
if not settings.TEST_SERVER_MODE:
|
||||
sns_backend = sns_backends["us-east-1"]
|
||||
sns_backend.topics[topic_arn].sent_notifications.should.have.length_of(1)
|
||||
notification = sns_backend.topics[topic_arn].sent_notifications[0]
|
||||
_, msg, subject, _, _ = notification
|
||||
|
Loading…
Reference in New Issue
Block a user