Skip to content

Commit 0e79b81

Browse files
Adding more tests and fixing small things
1 parent 006f854 commit 0e79b81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/functional/event_handler/test_openapi_validation_middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ def handler() -> Decimal:
145145
# THEN the body must be a decimal as int
146146
result = app(LOAD_GW_EVENT, {})
147147
assert result["statusCode"] == 200
148-
assert result["body"] == sample_decimal
148+
assert result["body"] == "10"
149149

150150

151151
def test_validate_return_decimal_as_float():
152152
# GIVEN an APIGatewayRestResolver with validation enabled
153153
app = APIGatewayRestResolver(enable_validation=True)
154154

155-
sample_decimal = Decimal(10.20)
155+
sample_decimal = Decimal(10.22)
156156

157157
# WHEN a handler is defined with a return type as Decimal
158158
@app.get("/")
@@ -165,7 +165,7 @@ def handler() -> Decimal:
165165
# THEN the body must be a decimal as float
166166
result = app(LOAD_GW_EVENT, {})
167167
assert result["statusCode"] == 200
168-
assert result["body"] == sample_decimal
168+
assert result["body"] == "10.22"
169169

170170

171171
def test_validate_return_purepath():

0 commit comments

Comments
 (0)