@@ -39,7 +39,6 @@ test('Create a function from basic_app', async () => {
3939 } ) ;
4040
4141 const template = Template . fromStack ( stack ) ;
42- console . log ( JSON . stringify ( template . toJSON ( ) , null , ' ' ) ) ;
4342
4443 template . hasResourceProperties ( 'AWS::Lambda::Function' , {
4544 Handler : 'handler.lambda_handler' ,
@@ -55,6 +54,29 @@ test('Create a function from basic_app', async () => {
5554 expect ( contents ) . toContain ( 'handler.py' ) ;
5655} ) ;
5756
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+
5880test ( 'Create a function with workspaces_app' , async ( ) => {
5981 const app = new App ( { } ) ;
6082 const stack = new Stack ( app , 'wstest' ) ;
@@ -68,7 +90,6 @@ test('Create a function with workspaces_app', async () => {
6890 } ) ;
6991
7092 const template = Template . fromStack ( stack ) ;
71- console . log ( JSON . stringify ( template . toJSON ( ) , null , ' ' ) ) ;
7293
7394 template . hasResourceProperties ( 'AWS::Lambda::Function' , {
7495 Handler : 'app_handler.handle_event' ,
0 commit comments