@@ -24,14 +24,14 @@ def test_authorizer_response_no_statement(builder: APIGatewayAuthorizerResponse)
24
24
25
25
def test_authorizer_response_invalid_verb (builder : APIGatewayAuthorizerResponse ):
26
26
with pytest .raises (ValueError , match = "Invalid HTTP verb: 'INVALID'" ):
27
- # GIVEN a invalid http_method
27
+ # GIVEN an invalid http_method
28
28
# WHEN calling deny_method
29
29
builder .deny_route (http_method = "INVALID" , resource = "foo" )
30
30
31
31
32
32
def test_authorizer_response_invalid_resource (builder : APIGatewayAuthorizerResponse ):
33
33
with pytest .raises (ValueError , match = "Invalid resource path: \$." ): # noqa: W605
34
- # GIVEN a invalid resource path "$"
34
+ # GIVEN an invalid resource path "$"
35
35
# WHEN calling deny_method
36
36
builder .deny_route (http_method = HttpVerb .GET .value , resource = "$" )
37
37
@@ -178,3 +178,20 @@ def test_deny_all():
178
178
"Effect" : "Deny" ,
179
179
"Resource" : ["*" ],
180
180
}
181
+
182
+
183
+ def test_authorizer_response_allow_route_with_underscore (builder : APIGatewayAuthorizerResponse ):
184
+ builder .allow_route (http_method = "GET" , resource = "/has_underscore" )
185
+ assert builder .asdict () == {
186
+ "principalId" : "foo" ,
187
+ "policyDocument" : {
188
+ "Version" : "2012-10-17" ,
189
+ "Statement" : [
190
+ {
191
+ "Action" : "execute-api:Invoke" ,
192
+ "Effect" : "Allow" ,
193
+ "Resource" : ["arn:aws:execute-api:us-west-1:123456789:fantom/dev/GET/has_underscore" ],
194
+ }
195
+ ],
196
+ },
197
+ }
0 commit comments