Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/aws/services/lambda_/test_lambda_developer_tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import time
from pathlib import Path

import pytest
from botocore.exceptions import ClientError
Expand Down Expand Up @@ -60,13 +61,21 @@ def test_hot_reloading(
f.write(function_content)

mount_path = get_host_path_for_path_in_docker(hot_reloading_dir_path)
create_lambda_function_aws(
create_function_response = create_lambda_function_aws(
FunctionName=function_name,
Handler="handler.handler",
Code={"S3Bucket": hot_reloading_bucket, "S3Key": mount_path},
Role=lambda_su_role,
Runtime=runtime,
)
# The AWS Toolkit for VS Code depends on this naming convention:
# https://github.com/aws/aws-toolkit-vscode/blob/1f6250148ba4f2c22e89613b8e7801bd8c4be062/packages/core/src/lambda/utils.ts#L212
assert create_function_response["CodeSha256"].startswith("hot-reloading")

get_function_response = aws_client.lambda_.get_function(FunctionName=function_name)
code_location_path = Path.from_uri(get_function_response["Code"]["Location"])
assert str(code_location_path) == mount_path

response = aws_client.lambda_.invoke(FunctionName=function_name, Payload=b"{}")
response_dict = json.load(response["Payload"])
assert response_dict["counter"] == 1
Expand Down
Loading