Skip to content

Commit 7599b05

Browse files
committed
fix test structure
1 parent 6e875e9 commit 7599b05

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/functional/event_handler/required_dependencies/test_api_gateway.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def read_media(file_name: str) -> bytes:
4848

4949

5050
LOAD_GW_EVENT = load_event("apiGatewayProxyEvent.json")
51+
LOAD_GW_EVENT_NO_ORIGIN = load_event("apiGatewayProxyEventNoOrigin.json")
5152
LOAD_GW_EVENT_TRAILING_SLASH = load_event("apiGatewayProxyEventPathTrailingSlash.json")
5253

5354

@@ -366,12 +367,10 @@ def with_cors() -> Response:
366367
def handler(event, context):
367368
return app.resolve(event, context)
368369

369-
event = LOAD_GW_EVENT.copy()
370-
del event["headers"]["Origin"]
371-
del event["multiValueHeaders"]["Origin"]
370+
event = LOAD_GW_EVENT_NO_ORIGIN
372371

373372
# WHEN calling the event handler
374-
result = handler(LOAD_GW_EVENT, None)
373+
result = handler(event, None)
375374

376375
# THEN the headers should include cors headers
377376
assert "multiValueHeaders" in result

0 commit comments

Comments
 (0)