@@ -39,7 +39,6 @@ test('Create a function from basic_app', async () => {
39
39
} ) ;
40
40
41
41
const template = Template . fromStack ( stack ) ;
42
- console . log ( JSON . stringify ( template . toJSON ( ) , null , ' ' ) ) ;
43
42
44
43
template . hasResourceProperties ( 'AWS::Lambda::Function' , {
45
44
Handler : 'handler.lambda_handler' ,
@@ -55,6 +54,29 @@ test('Create a function from basic_app', async () => {
55
54
expect ( contents ) . toContain ( 'handler.py' ) ;
56
55
} ) ;
57
56
57
+ test ( 'Create a function from basic_app with no .py index extension' , async ( ) => {
58
+ const app = new App ( { } ) ;
59
+ const stack = new Stack ( app , 'test' ) ;
60
+ new PythonFunction ( stack , 'basic_app' , {
61
+ rootDir : path . join ( resourcesPath , 'basic_app' ) ,
62
+ index : 'handler' ,
63
+ handler : 'lambda_handler' ,
64
+ runtime : Runtime . PYTHON_3_12 ,
65
+ architecture : await getDockerHostArch ( ) ,
66
+ } ) ;
67
+
68
+ const template = Template . fromStack ( stack ) ;
69
+
70
+ template . hasResourceProperties ( 'AWS::Lambda::Function' , {
71
+ Handler : 'handler.lambda_handler' ,
72
+ Runtime : 'python3.12' ,
73
+ Code : {
74
+ S3Bucket : Match . anyValue ( ) ,
75
+ S3Key : Match . anyValue ( ) ,
76
+ } ,
77
+ } ) ;
78
+ } ) ;
79
+
58
80
test ( 'Create a function with workspaces_app' , async ( ) => {
59
81
const app = new App ( { } ) ;
60
82
const stack = new Stack ( app , 'wstest' ) ;
@@ -68,7 +90,6 @@ test('Create a function with workspaces_app', async () => {
68
90
} ) ;
69
91
70
92
const template = Template . fromStack ( stack ) ;
71
- console . log ( JSON . stringify ( template . toJSON ( ) , null , ' ' ) ) ;
72
93
73
94
template . hasResourceProperties ( 'AWS::Lambda::Function' , {
74
95
Handler : 'app_handler.handle_event' ,
0 commit comments