-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop false positive generic resource templates from being tested (#179)
* Fix failing test_S3CrossAccountTrustRule.py::test_s3_bucket_cross_account This root of this was quickly found by setting `GenericResource.ALLOW_EXISTING_TYPES = False` which defaults to true. * Fix template for test_s3_bucket_cross_account test The `Resource` property has to be a string, a list of them, or something that will resolve to one of them. It was previously a list of a string and a 'list of strings'. This commit converts it to a list of something that resolves to a string. * Fix Wildcard Resource Rule test that was failing from a malformed template This is not passing pydantic validation due to not having a PolicyName property. However, this was by design, so I have kept the test and have it test for the error. There exists an equivalent test that has the PolicyName property, so no test seemingly missing here by not having it. See here https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html PolicyName is `Required: Yes` as it is in the pycfmodel too https://github.com/Skyscanner/pycfmodel/blob/master/pycfmodel/model/resources/properties/policy.py#L16 * Fix Wildcard Resource Rule test that was failing from a malformed template This is not passing pydantic validation due to not having a PolicyName property. However, this was by design, so I have kept the test and have it test for the error. There exists an equivalent test that has the PolicyName property, so no test seemingly missing here by not having it. See here https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html PolicyName is `Required: Yes` as it is in the pycfmodel too https://github.com/Skyscanner/pycfmodel/blob/master/pycfmodel/model/resources/properties/policy.py#L16 * Disallow generic resource for those resources with a known Type property in tests
- Loading branch information
Showing
4 changed files
with
39 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters