Skip to content

Commit

Permalink
Do some extra cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Oct 17, 2024
1 parent b48d791 commit 5e7280c
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions test/unit/rules/functions/test_getatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ def validate(self, validator, s, instance, schema):


@pytest.mark.parametrize(
"name,instance,schema,strict_types,template,child_rules,expected",
"name,instance,schema,template,child_rules,expected",
[
(
"Valid GetAtt with a good attribute",
{"Fn::GetAtt": ["MyBucket", "Arn"]},
{"type": "string"},
{},
_template,
{},
[],
Expand All @@ -71,7 +70,6 @@ def validate(self, validator, s, instance, schema):
"Invalid GetAtt with bad attribute",
{"Fn::GetAtt": ["MyBucket", "foo"]},
{"type": "string"},
{},
_template,
{},
[
Expand All @@ -91,7 +89,6 @@ def validate(self, validator, s, instance, schema):
"Invalid GetAtt with bad resource name",
{"Fn::GetAtt": ["Foo", "bar"]},
{"type": "string"},
{},
_template,
{},
[
Expand All @@ -110,7 +107,6 @@ def validate(self, validator, s, instance, schema):
"Invalid GetAtt with a bad type",
{"Fn::GetAtt": {"foo": "bar"}},
{"type": "string"},
{},
_template,
{},
[
Expand All @@ -126,7 +122,6 @@ def validate(self, validator, s, instance, schema):
"Invalid GetAtt with a bad response type",
{"Fn::GetAtt": "MyBucket.Arn"},
{"type": "array"},
{},
_template,
{},
[
Expand All @@ -142,7 +137,6 @@ def validate(self, validator, s, instance, schema):
"Invalid GetAtt with a bad response type and multiple types",
{"Fn::GetAtt": "MyBucket.Arn"},
{"type": ["array", "object"]},
{},
_template,
{},
[
Expand All @@ -158,7 +152,6 @@ def validate(self, validator, s, instance, schema):
"Valid GetAtt with integer to string",
{"Fn::GetAtt": "MyCodePipeline.Version"},
{"type": ["integer"]},
{},
_template,
{},
[],
Expand All @@ -167,9 +160,6 @@ def validate(self, validator, s, instance, schema):
"Valid GetAtt with exception type",
{"Fn::GetAtt": "DocDBCluster.Port"},
{"type": ["string"]},
{
"strict_types": True,
},
_template,
{},
[],
Expand Down Expand Up @@ -198,7 +188,6 @@ def validate(self, validator, s, instance, schema):
"Valid GetAtt with one good response type",
{"Fn::GetAtt": "MyBucket.Arn"},
{"type": ["array", "string"]},
{},
_template,
{},
[],
Expand All @@ -207,7 +196,6 @@ def validate(self, validator, s, instance, schema):
"Valid Ref in GetAtt for resource",
{"Fn::GetAtt": [{"Ref": "MyResourceParameter"}, "Arn"]},
{"type": "string"},
{},
_template_with_transform,
{},
[],
Expand All @@ -216,7 +204,6 @@ def validate(self, validator, s, instance, schema):
"Valid Ref in GetAtt for attribute",
{"Fn::GetAtt": ["MyBucket", {"Ref": "MyAttributeParameter"}]},
{"type": "string"},
{},
_template_with_transform,
{},
[],
Expand All @@ -225,7 +212,6 @@ def validate(self, validator, s, instance, schema):
"Invalid Ref in GetAtt for attribute",
{"Fn::GetAtt": ["MyBucket", {"Ref": "MyResourceParameter"}]},
{"type": "string"},
{},
_template_with_transform,
{},
[
Expand All @@ -245,7 +231,6 @@ def validate(self, validator, s, instance, schema):
"Invalid Ref in GetAtt for attribute",
{"Fn::GetAtt": [{"Ref": "MyAttributeParameter"}, "Arn"]},
{"type": "string"},
{},
_template_with_transform,
{},
[
Expand All @@ -265,7 +250,6 @@ def validate(self, validator, s, instance, schema):
"Valid GetAtt with child rules",
{"Fn::GetAtt": ["MyBucket", "Arn"]},
{"type": "string"},
{},
_template,
{
"AAAAA": _Pass(),
Expand All @@ -275,7 +259,7 @@ def validate(self, validator, s, instance, schema):
[ValidationError("Fail")],
),
],
indirect=["template", "strict_types"],
indirect=["template"],
)
def test_validate(name, instance, schema, child_rules, expected, validator, rule):
rule.child_rules = child_rules
Expand Down

0 comments on commit 5e7280c

Please sign in to comment.