Add sns.list_tags_for_resource

This commit is contained in:
gruebel 2019-10-11 17:58:48 +02:00
commit 8d527743d5
4 changed files with 75 additions and 4 deletions

View file

@ -44,6 +44,37 @@ def test_create_topic_with_attributes():
attributes['DisplayName'].should.equal('test-topic')
@mock_sns
def test_create_topic_with_tags():
conn = boto3.client("sns", region_name="us-east-1")
conn.create_topic(
Name='some-topic-with-attribute',
Tags=[
{
'Key': 'tag_key_1',
'Value': 'tag_value_1'
},
{
'Key': 'tag_key_2',
'Value': 'tag_value_2'
}
]
)
topics_json = conn.list_topics()
topic_arn = topics_json["Topics"][0]['TopicArn']
conn.list_tags_for_resource(ResourceArn=topic_arn)['Tags'].should.equal([
{
'Key': 'tag_key_1',
'Value': 'tag_value_1'
},
{
'Key': 'tag_key_2',
'Value': 'tag_value_2'
}
])
@mock_sns
def test_create_topic_should_be_indempodent():
conn = boto3.client("sns", region_name="us-east-1")