File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
tests/functional/event_handler/required_dependencies Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ def decimal_serializer(obj):
441441 @app .tool ()
442442 def decimal_response ():
443443 # Return a response with Decimal type that standard JSON can't serialize
444- return {"price" : decimal .Decimal ("99.99" )}
444+ return {"price" : round ( decimal .Decimal ("99" ) )}
445445
446446 # WHEN calling with a response containing non-standard JSON types
447447 raw_event = load_event ("bedrockAgentFunctionEvent.json" )
@@ -450,7 +450,6 @@ def decimal_response():
450450
451451 # THEN non-standard types should be properly serialized
452452 response_body = result ["response" ]["functionResponse" ]["responseBody" ]["TEXT" ]["body" ]
453- parsed_response = json .loads (response_body )
454453
455454 # VERIFY that decimal was converted to float and datetime to ISO string
456- assert parsed_response [ "price" ] == 99.99
455+ assert response_body == json . dumps ({ "price" : 99 })
You can’t perform that action at this time.
0 commit comments