@@ -49,11 +49,12 @@ def test_resources():
49
49
50
50
51
51
@pytest .mark .parametrize (
52
- "name,instance,decode_results,expected_getatts" ,
52
+ "name,instance,filename, decode_results,expected_getatts" ,
53
53
[
54
54
(
55
55
"Nested stack with no Properties" ,
56
56
{"Type" : "AWS::CloudFormation::Stack" },
57
+ "foo/bar.yaml" ,
57
58
None ,
58
59
AttributeDict ({"Outputs\\ ..*" : "/properties/CfnLintStringType" }),
59
60
),
@@ -63,6 +64,17 @@ def test_resources():
63
64
"Type" : "AWS::CloudFormation::Stack" ,
64
65
"Properties" : {"TemplateURL" : "https://bucket/path.yaml" },
65
66
},
67
+ "foo/bar.yaml" ,
68
+ None ,
69
+ AttributeDict ({"Outputs\\ ..*" : "/properties/CfnLintStringType" }),
70
+ ),
71
+ (
72
+ "Nested stack with a None filename" ,
73
+ {
74
+ "Type" : "AWS::CloudFormation::Stack" ,
75
+ "Properties" : {"TemplateURL" : "application.yaml" },
76
+ },
77
+ None ,
66
78
None ,
67
79
AttributeDict ({"Outputs\\ ..*" : "/properties/CfnLintStringType" }),
68
80
),
@@ -72,6 +84,7 @@ def test_resources():
72
84
"Type" : "AWS::CloudFormation::Stack" ,
73
85
"Properties" : {"TemplateURL" : "./bar.yaml" },
74
86
},
87
+ "foo/bar.yaml" ,
75
88
({"Outputs" : {"MyValue" : {"Type" : "String" }}}, None ),
76
89
AttributeDict ({"Outputs.MyValue" : "/properties/CfnLintStringType" }),
77
90
),
@@ -81,6 +94,7 @@ def test_resources():
81
94
"Type" : "AWS::CloudFormation::Stack" ,
82
95
"Properties" : {"TemplateURL" : "./bar.yaml" },
83
96
},
97
+ "foo/bar.yaml" ,
84
98
({}, None ),
85
99
AttributeDict ({}),
86
100
),
@@ -90,14 +104,14 @@ def test_resources():
90
104
"Type" : "AWS::CloudFormation::Stack" ,
91
105
"Properties" : {"TemplateURL" : "./bar.yaml" },
92
106
},
107
+ "foo/bar.yaml" ,
93
108
(None , Match ("test" , rule = ParseError ())),
94
109
AttributeDict ({"Outputs\\ ..*" : "/properties/CfnLintStringType" }),
95
110
),
96
111
],
97
112
)
98
- def test_nested_stacks (name , instance , decode_results , expected_getatts ):
113
+ def test_nested_stacks (name , instance , filename , decode_results , expected_getatts ):
99
114
region = "us-east-1"
100
- filename = "foo/bar.yaml"
101
115
102
116
with patch ("cfnlint.decode.decode" ) as mock_decode :
103
117
if decode_results is not None :
0 commit comments