Skip to content

Commit 4c4e4fa

Browse files
committed
fix: Update MockLambdaContext to include identity and client_context attributes for improved testing accuracy
1 parent 4bab894 commit 4c4e4fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/tests/test_lambda_function.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class MockLambdaContext:
1818
aws_request_id: str = "test-request-id"
1919
log_group_name: str = "/aws/lambda/test"
2020
log_stream_name: str = "test-stream"
21+
identity: None = None
22+
client_context: None = None
2123

2224
def get_remaining_time_in_millis(self) -> int:
2325
return 30000
@@ -121,7 +123,7 @@ def test_handler_with_api_gateway_event(self):
121123
"isBase64Encoded": False,
122124
}
123125

124-
result = handler(event, MockLambdaContext())
126+
result = handler(event, MockLambdaContext()) # type: ignore[arg-type]
125127
assert result["statusCode"] == 200
126128
body = json.loads(result["body"])
127129
assert body["status"] == "ok"

0 commit comments

Comments
 (0)