fix test cases, bug when no tags are present and conflict
This commit is contained in:
parent
38413577fc
commit
1221d2653a
6 changed files with 58 additions and 47 deletions
|
|
@ -248,26 +248,3 @@ def test_get_many_resources():
|
|||
)
|
||||
|
||||
# TODO test pagenation
|
||||
|
||||
|
||||
@mock_kms
|
||||
def test_get_kms_tags():
|
||||
kms = boto3.client("kms", region_name="us-east-1")
|
||||
key = kms.create_key(
|
||||
KeyUsage="ENCRYPT_DECRYPT",
|
||||
Tags=[
|
||||
{"TagKey": "key_name", "TagValue": "a_value"},
|
||||
{"TagKey": "key_2", "TagValue": "val2"},
|
||||
],
|
||||
)
|
||||
key_id = key["KeyMetadata"]["KeyId"]
|
||||
|
||||
rtapi = boto3.client("resourcegroupstaggingapi", region_name="us-east-1")
|
||||
resp = rtapi.get_resources(
|
||||
ResourceTypeFilters=["kms"],
|
||||
TagFilters=[{"Key": "key_name"}],
|
||||
)
|
||||
resp["ResourceTagMappingList"].should.have.length_of(1)
|
||||
resp["ResourceTagMappingList"][0]["Tags"].should.contain(
|
||||
{"Key": "key_name", "Value": "a_value"}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue