@@ -15,7 +15,7 @@ def test_authorizer_response_no_statement(builder: APIGatewayAuthorizerResponse)
15
15
# GIVEN a builder with no statements
16
16
with pytest .raises (NameError ) as ex :
17
17
# WHEN calling build
18
- builder .build ()
18
+ builder .asdict ()
19
19
20
20
# THEN raise a name error for not statements
21
21
assert str (ex .value ) == "No statements defined for the policy"
@@ -44,7 +44,7 @@ def test_authorizer_response_invalid_resource(builder: APIGatewayAuthorizerRespo
44
44
def test_authorizer_response_allow_all_methods_with_context ():
45
45
builder = APIGatewayAuthorizerResponse ("foo" , "us-west-1" , "123456789" , "fantom" , "dev" , {"name" : "Foo" })
46
46
builder .allow_all_methods ()
47
- assert builder .build () == {
47
+ assert builder .asdict () == {
48
48
"principalId" : "foo" ,
49
49
"policyDocument" : {
50
50
"Version" : "2012-10-17" ,
@@ -62,7 +62,7 @@ def test_authorizer_response_allow_all_methods_with_context():
62
62
63
63
def test_authorizer_response_deny_all_methods (builder : APIGatewayAuthorizerResponse ):
64
64
builder .deny_all_methods ()
65
- assert builder .build () == {
65
+ assert builder .asdict () == {
66
66
"principalId" : "foo" ,
67
67
"policyDocument" : {
68
68
"Version" : "2012-10-17" ,
@@ -79,7 +79,7 @@ def test_authorizer_response_deny_all_methods(builder: APIGatewayAuthorizerRespo
79
79
80
80
def test_authorizer_response_allow_method (builder : APIGatewayAuthorizerResponse ):
81
81
builder .allow_method (HttpVerb .GET , "/foo" )
82
- assert builder .build () == {
82
+ assert builder .asdict () == {
83
83
"policyDocument" : {
84
84
"Version" : "2012-10-17" ,
85
85
"Statement" : [
@@ -96,7 +96,7 @@ def test_authorizer_response_allow_method(builder: APIGatewayAuthorizerResponse)
96
96
97
97
def test_authorizer_response_deny_method (builder : APIGatewayAuthorizerResponse ):
98
98
builder .deny_method (HttpVerb .PUT , "foo" )
99
- assert builder .build () == {
99
+ assert builder .asdict () == {
100
100
"principalId" : "foo" ,
101
101
"policyDocument" : {
102
102
"Version" : "2012-10-17" ,
@@ -119,7 +119,7 @@ def test_authorizer_response_allow_method_with_conditions(builder: APIGatewayAut
119
119
{"StringEquals" : {"method.request.header.Content-Type" : "text/html" }},
120
120
],
121
121
)
122
- assert builder .build () == {
122
+ assert builder .asdict () == {
123
123
"principalId" : "foo" ,
124
124
"policyDocument" : {
125
125
"Version" : "2012-10-17" ,
@@ -143,7 +143,7 @@ def test_authorizer_response_deny_method_with_conditions(builder: APIGatewayAuth
143
143
{"StringEquals" : {"method.request.header.Content-Type" : "application/json" }},
144
144
],
145
145
)
146
- assert builder .build () == {
146
+ assert builder .asdict () == {
147
147
"principalId" : "foo" ,
148
148
"policyDocument" : {
149
149
"Version" : "2012-10-17" ,
0 commit comments