Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit abb44e3

Browse files
authored
Add hot reload regression test cases for implicit behavior (#13183)
1 parent 4d7c543 commit abb44e3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/aws/services/lambda_/test_lambda_developer_tools.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import os
33
import time
4+
from pathlib import Path
45

56
import pytest
67
from botocore.exceptions import ClientError
@@ -60,13 +61,21 @@ def test_hot_reloading(
6061
f.write(function_content)
6162

6263
mount_path = get_host_path_for_path_in_docker(hot_reloading_dir_path)
63-
create_lambda_function_aws(
64+
create_function_response = create_lambda_function_aws(
6465
FunctionName=function_name,
6566
Handler="handler.handler",
6667
Code={"S3Bucket": hot_reloading_bucket, "S3Key": mount_path},
6768
Role=lambda_su_role,
6869
Runtime=runtime,
6970
)
71+
# The AWS Toolkit for VS Code depends on this naming convention:
72+
# https://github.com/aws/aws-toolkit-vscode/blob/1f6250148ba4f2c22e89613b8e7801bd8c4be062/packages/core/src/lambda/utils.ts#L212
73+
assert create_function_response["CodeSha256"].startswith("hot-reloading")
74+
75+
get_function_response = aws_client.lambda_.get_function(FunctionName=function_name)
76+
code_location_path = Path.from_uri(get_function_response["Code"]["Location"])
77+
assert str(code_location_path) == mount_path
78+
7079
response = aws_client.lambda_.invoke(FunctionName=function_name, Payload=b"{}")
7180
response_dict = json.load(response["Payload"])
7281
assert response_dict["counter"] == 1

0 commit comments

Comments
 (0)