File tree 1 file changed +24
-0
lines changed
tests/functional/event_handler
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -879,3 +879,27 @@ def foo(app):
879
879
# THEN process event correctly
880
880
assert result ["statusCode" ] == 200
881
881
assert result ["headers" ]["Content-Type" ] == content_types .APPLICATION_JSON
882
+
883
+
884
+ def test_api_gateway_app_proxy_with_params ():
885
+ # GIVEN a Blueprint with registered routes
886
+ app = ApiGatewayResolver ()
887
+ blueprint = Blueprint ()
888
+ req = "foo"
889
+ event = deepcopy (LOAD_GW_EVENT )
890
+ event ["resource" ] = "/accounts/{account_id}"
891
+ event ["path" ] = f"/accounts/{ req } "
892
+
893
+ @blueprint .route (rule = "/accounts/<account_id>" , method = ["GET" , "POST" ])
894
+ def foo (app : ApiGatewayResolver , account_id ):
895
+ assert app .current_event .raw_event == event
896
+ assert account_id == f"{ req } "
897
+ return {}
898
+
899
+ app .register_blueprint (blueprint )
900
+ # WHEN calling the event handler after applying routes from blueprint object
901
+ result = app (event , {})
902
+
903
+ # THEN process event correctly
904
+ assert result ["statusCode" ] == 200
905
+ assert result ["headers" ]["Content-Type" ] == content_types .APPLICATION_JSON
You can’t perform that action at this time.
0 commit comments