@@ -24,14 +24,14 @@ def test_authorizer_response_no_statement(builder: APIGatewayAuthorizerResponse)
2424
2525def test_authorizer_response_invalid_verb (builder : APIGatewayAuthorizerResponse ):
2626 with pytest .raises (ValueError , match = "Invalid HTTP verb: 'INVALID'" ):
27- # GIVEN a invalid http_method
27+ # GIVEN an invalid http_method
2828 # WHEN calling deny_method
2929 builder .deny_route (http_method = "INVALID" , resource = "foo" )
3030
3131
3232def test_authorizer_response_invalid_resource (builder : APIGatewayAuthorizerResponse ):
3333 with pytest .raises (ValueError , match = "Invalid resource path: \$." ): # noqa: W605
34- # GIVEN a invalid resource path "$"
34+ # GIVEN an invalid resource path "$"
3535 # WHEN calling deny_method
3636 builder .deny_route (http_method = HttpVerb .GET .value , resource = "$" )
3737
@@ -178,3 +178,20 @@ def test_deny_all():
178178 "Effect" : "Deny" ,
179179 "Resource" : ["*" ],
180180 }
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