diff --git a/tests/aws/services/lambda_/test_lambda_developer_tools.py b/tests/aws/services/lambda_/test_lambda_developer_tools.py index 91caff74c3397..97e2025fd8d08 100644 --- a/tests/aws/services/lambda_/test_lambda_developer_tools.py +++ b/tests/aws/services/lambda_/test_lambda_developer_tools.py @@ -1,6 +1,7 @@ import json import os import time +from pathlib import Path import pytest from botocore.exceptions import ClientError @@ -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