delete tags when their resource is deleted
This commit is contained in:
parent
414f8086b0
commit
c95254a284
3 changed files with 21 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ def test_create_tag():
|
|||
|
||||
expected.should.be.equal(actual)
|
||||
|
||||
|
||||
def test_create_tag_without_value():
|
||||
svc = TaggingService()
|
||||
tags = [{"Key": "key_key"}]
|
||||
|
|
@ -28,6 +29,7 @@ def test_create_tag_without_value():
|
|||
|
||||
expected.should.be.equal(actual)
|
||||
|
||||
|
||||
def test_delete_tag_using_names():
|
||||
svc = TaggingService()
|
||||
tags = [{"Key": "key_key", "Value": "value_value"}]
|
||||
|
|
@ -37,6 +39,19 @@ def test_delete_tag_using_names():
|
|||
|
||||
{"Tags": []}.should.be.equal(result)
|
||||
|
||||
|
||||
def test_delete_all_tags_for_resource():
|
||||
svc = TaggingService()
|
||||
tags = [{"Key": "key_key", "Value": "value_value"}]
|
||||
tags2 = [{"Key": "key_key2", "Value": "value_value2"}]
|
||||
svc.tag_resource("arn", tags)
|
||||
svc.tag_resource("arn", tags2)
|
||||
svc.delete_all_tags_for_resource("arn")
|
||||
result = svc.list_tags_for_resource("arn")
|
||||
|
||||
{"Tags": []}.should.be.equal(result)
|
||||
|
||||
|
||||
def test_list_empty_delete():
|
||||
svc = TaggingService()
|
||||
svc.untag_resource_using_names("arn", ["key_key"])
|
||||
|
|
@ -44,6 +59,7 @@ def test_list_empty_delete():
|
|||
|
||||
{"Tags": []}.should.be.equal(result)
|
||||
|
||||
|
||||
def test_delete_tag_using_tags():
|
||||
svc = TaggingService()
|
||||
tags = [{"Key": "key_key", "Value": "value_value"}]
|
||||
|
|
@ -61,4 +77,3 @@ def test_extract_tag_names():
|
|||
expected = ["key1", "key2"]
|
||||
|
||||
expected.should.be.equal(actual)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue