diff --git a/tests/test_iot/test_iot.py b/tests/test_iot/test_iot.py index 9082203d9..47ea9d59b 100644 --- a/tests/test_iot/test_iot.py +++ b/tests/test_iot/test_iot.py @@ -318,6 +318,15 @@ def test_principal_policy(): client.attach_policy(policyName=policy_name, target=cert_arn) + res = client.list_principal_policies(principal=cert_arn) + res.should.have.key('policies').which.should.have.length_of(1) + for policy in res['policies']: + policy.should.have.key('policyName').which.should_not.be.none + policy.should.have.key('policyArn').which.should_not.be.none + + # do nothing if policy have already attached to certificate + client.attach_policy(policyName=policy_name, target=cert_arn) + res = client.list_principal_policies(principal=cert_arn) res.should.have.key('policies').which.should.have.length_of(1) for policy in res['policies']: