SNS - duplicate deprecated tests (#4328)
This commit is contained in:
parent
e88e73aac7
commit
d1e105f2f2
@ -7,6 +7,7 @@ from moto.core import ACCOUNT_ID
|
||||
import sure # noqa
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_create_platform_application():
|
||||
conn = boto.connect_sns()
|
||||
@ -26,6 +27,7 @@ def test_create_platform_application():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_get_platform_application_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -51,6 +53,7 @@ def test_get_platform_application_attributes():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_get_missing_platform_application_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -59,6 +62,7 @@ def test_get_missing_platform_application_attributes():
|
||||
).should.throw(BotoServerError)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_set_platform_application_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -82,6 +86,7 @@ def test_set_platform_application_attributes():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_list_platform_applications():
|
||||
conn = boto.connect_sns()
|
||||
@ -95,6 +100,7 @@ def test_list_platform_applications():
|
||||
applications.should.have.length_of(2)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_delete_platform_application():
|
||||
conn = boto.connect_sns()
|
||||
@ -117,6 +123,7 @@ def test_delete_platform_application():
|
||||
applications.should.have.length_of(1)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_create_platform_endpoint():
|
||||
conn = boto.connect_sns()
|
||||
@ -142,6 +149,7 @@ def test_create_platform_endpoint():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_get_list_endpoints_by_platform_application():
|
||||
conn = boto.connect_sns()
|
||||
@ -175,6 +183,7 @@ def test_get_list_endpoints_by_platform_application():
|
||||
endpoint_list[0]["EndpointArn"].should.equal(endpoint_arn)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_get_endpoint_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -203,6 +212,7 @@ def test_get_endpoint_attributes():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_get_missing_endpoint_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -211,6 +221,7 @@ def test_get_missing_endpoint_attributes():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_set_endpoint_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -240,6 +251,7 @@ def test_set_endpoint_attributes():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_delete_endpoint():
|
||||
conn = boto.connect_sns()
|
||||
@ -282,6 +294,7 @@ def test_delete_endpoint():
|
||||
endpoint_list.should.have.length_of(0)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_publish_to_platform_endpoint():
|
||||
conn = boto.connect_sns()
|
||||
|
@ -279,6 +279,31 @@ def test_set_endpoint_attributes():
|
||||
)
|
||||
|
||||
|
||||
@mock_sns
|
||||
def test_delete_endpoint():
|
||||
conn = boto3.client("sns", region_name="us-east-1")
|
||||
platform_application = conn.create_platform_application(
|
||||
Name="my-application", Platform="APNS", Attributes={}
|
||||
)
|
||||
application_arn = platform_application["PlatformApplicationArn"]
|
||||
endpoint = conn.create_platform_endpoint(
|
||||
PlatformApplicationArn=application_arn,
|
||||
Token="some_unique_id",
|
||||
CustomUserData="some user data",
|
||||
Attributes={"Enabled": "true"},
|
||||
)
|
||||
|
||||
conn.list_endpoints_by_platform_application(PlatformApplicationArn=application_arn)[
|
||||
"Endpoints"
|
||||
].should.have.length_of(1)
|
||||
|
||||
conn.delete_endpoint(EndpointArn=endpoint["EndpointArn"])
|
||||
|
||||
conn.list_endpoints_by_platform_application(PlatformApplicationArn=application_arn)[
|
||||
"Endpoints"
|
||||
].should.have.length_of(0)
|
||||
|
||||
|
||||
@mock_sns
|
||||
def test_publish_to_platform_endpoint():
|
||||
conn = boto3.client("sns", region_name="us-east-1")
|
||||
|
@ -18,6 +18,7 @@ MESSAGE_FROM_SQS_TEMPLATE = (
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sqs_deprecated
|
||||
@mock_sns_deprecated
|
||||
def test_publish_to_sqs():
|
||||
@ -62,6 +63,7 @@ def test_publish_to_sqs():
|
||||
acquired_message.should.equal(expected)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sqs_deprecated
|
||||
@mock_sns_deprecated
|
||||
def test_publish_to_sqs_in_different_region():
|
||||
|
@ -7,6 +7,7 @@ from moto import mock_sns_deprecated
|
||||
from moto.sns.models import DEFAULT_PAGE_SIZE
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_creating_subscription():
|
||||
conn = boto.connect_sns()
|
||||
@ -38,6 +39,7 @@ def test_creating_subscription():
|
||||
subscriptions.should.have.length_of(0)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_deleting_subscriptions_by_deleting_topic():
|
||||
conn = boto.connect_sns()
|
||||
@ -86,6 +88,7 @@ def test_deleting_subscriptions_by_deleting_topic():
|
||||
conn.unsubscribe(subscription_arn)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_getting_subscriptions_by_topic():
|
||||
conn = boto.connect_sns()
|
||||
@ -107,6 +110,7 @@ def test_getting_subscriptions_by_topic():
|
||||
topic1_subscriptions[0]["Endpoint"].should.equal("http://example1.com/")
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_subscription_paging():
|
||||
conn = boto.connect_sns()
|
||||
|
@ -10,6 +10,7 @@ from moto.sns.models import DEFAULT_EFFECTIVE_DELIVERY_POLICY, DEFAULT_PAGE_SIZE
|
||||
from moto.core import ACCOUNT_ID
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_create_and_delete_topic():
|
||||
conn = boto.connect_sns()
|
||||
@ -31,12 +32,14 @@ def test_create_and_delete_topic():
|
||||
topics.should.have.length_of(0)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_delete_non_existent_topic():
|
||||
conn = boto.connect_sns()
|
||||
conn.delete_topic.when.called_with("a-fake-arn").should.throw(BotoServerError)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_get_missing_topic():
|
||||
conn = boto.connect_sns()
|
||||
@ -45,6 +48,7 @@ def test_get_missing_topic():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_create_topic_in_multiple_regions():
|
||||
for region in ["us-west-1", "us-west-2"]:
|
||||
@ -55,6 +59,7 @@ def test_create_topic_in_multiple_regions():
|
||||
).should.have.length_of(1)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_topic_corresponds_to_region():
|
||||
for region in ["us-east-1", "us-west-2"]:
|
||||
@ -69,6 +74,7 @@ def test_topic_corresponds_to_region():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_topic_attributes():
|
||||
conn = boto.connect_sns()
|
||||
@ -140,6 +146,7 @@ def test_topic_attributes():
|
||||
)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_topic_paging():
|
||||
conn = boto.connect_sns()
|
||||
@ -161,6 +168,7 @@ def test_topic_paging():
|
||||
next_token.should.equal(None)
|
||||
|
||||
|
||||
# Has boto3 equivalent
|
||||
@mock_sns_deprecated
|
||||
def test_topic_kms_master_key_id_attribute():
|
||||
conn = boto.connect_sns()
|
||||
|
Loading…
Reference in New Issue
Block a user