This repository was archived by the owner on Mar 23, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
tests/aws/services/lambda_ Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import json
22import os
33import time
4+ from pathlib import Path
45
56import pytest
67from 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
You can’t perform that action at this time.
0 commit comments