@@ -212,6 +212,19 @@ class TestSamFunctionProviderEndToEnd(TestCase):
212
212
"aws:asset:property" : "Code" ,
213
213
},
214
214
},
215
+ "LambdaCDKFuncWithInvalidCDKPath" : {
216
+ "Type" : "AWS::Lambda::Function" ,
217
+ "Properties" : {
218
+ "Code" : {"Bucket" : "bucket" , "Key" : "key" },
219
+ "Runtime" : "nodejs4.3" ,
220
+ "Handler" : "index.handler" ,
221
+ },
222
+ "Metadata" : {
223
+ "aws:cdk:path" : "Stack/LambdaCFKFunction-x/Lambda/Resource" ,
224
+ "aws:asset:path" : "/usr/foo/bar" ,
225
+ "aws:asset:property" : "Code" ,
226
+ },
227
+ },
215
228
"OtherResource" : {
216
229
"Type" : "AWS::Serverless::Api" ,
217
230
"Properties" : {"StageName" : "prod" , "DefinitionUri" : "s3://bucket/key" },
@@ -929,6 +942,39 @@ def setUp(self):
929
942
function_build_info = FunctionBuildInfo .BuildableZip ,
930
943
),
931
944
),
945
+ (
946
+ "LambdaCDKFuncWithInvalidCDKPath" ,
947
+ Function (
948
+ function_id = "LambdaCDKFuncWithInvalidCDKPath" ,
949
+ name = "LambdaCDKFuncWithInvalidCDKPath" ,
950
+ functionname = "LambdaCDKFuncWithInvalidCDKPath" ,
951
+ runtime = "nodejs4.3" ,
952
+ handler = "index.handler" ,
953
+ codeuri = "/usr/foo/bar" ,
954
+ memory = None ,
955
+ timeout = None ,
956
+ environment = None ,
957
+ rolearn = None ,
958
+ layers = [],
959
+ events = None ,
960
+ metadata = {
961
+ "aws:cdk:path" : "Stack/LambdaCFKFunction-x/Lambda/Resource" ,
962
+ "aws:asset:path" : "/usr/foo/bar" ,
963
+ "aws:asset:property" : "Code" ,
964
+ "SamNormalized" : True ,
965
+ "SamResourceId" : "LambdaCDKFuncWithInvalidCDKPath" ,
966
+ },
967
+ inlinecode = None ,
968
+ imageuri = None ,
969
+ imageconfig = None ,
970
+ packagetype = ZIP ,
971
+ codesign_config_arn = None ,
972
+ architectures = None ,
973
+ function_url_config = None ,
974
+ stack_path = "" ,
975
+ function_build_info = FunctionBuildInfo .BuildableZip ,
976
+ ),
977
+ ),
932
978
(
933
979
"LambdaCDKFuncInChild-x" ,
934
980
Function (
@@ -1059,6 +1105,7 @@ def test_get_all_must_return_all_functions(self):
1059
1105
"LambdaFuncWithCodeSignConfig" ,
1060
1106
"LambdaFunctionCustomId-x" ,
1061
1107
"LambdaCFKFunction-x" ,
1108
+ "LambdaCDKFuncWithInvalidCDKPath" ,
1062
1109
posixpath .join ("ChildStack" , "SamFunctionsInChild" ),
1063
1110
posixpath .join ("ChildStack" , "SamFunctionsInChildAbsPath" ),
1064
1111
posixpath .join ("ChildStack" , "SamImageFunctionsInChild" ),
0 commit comments