@@ -45,6 +45,7 @@ beforeEach(() => {
45
45
test ( 'PythonFunction with defaults' , ( ) => {
46
46
new PythonFunction ( stack , 'handler' , {
47
47
entry : 'test/lambda-handler' ,
48
+ runtime : Runtime . PYTHON_3_8 ,
48
49
} ) ;
49
50
50
51
expect ( bundle ) . toHaveBeenCalledWith ( expect . objectContaining ( {
@@ -62,6 +63,7 @@ test('PythonFunction with index in a subdirectory', () => {
62
63
entry : 'test/lambda-handler-sub' ,
63
64
index : 'inner/custom_index.py' ,
64
65
handler : 'custom_handler' ,
66
+ runtime : Runtime . PYTHON_3_8 ,
65
67
} ) ;
66
68
67
69
expect ( bundle ) . toHaveBeenCalledWith ( expect . objectContaining ( {
@@ -78,12 +80,14 @@ test('throws when index is not py', () => {
78
80
expect ( ( ) => new PythonFunction ( stack , 'Fn' , {
79
81
entry : 'test/lambda-handler' ,
80
82
index : 'index.js' ,
83
+ runtime : Runtime . PYTHON_3_8 ,
81
84
} ) ) . toThrow ( / O n l y P y t h o n \( \. p y \) i n d e x f i l e s a r e s u p p o r t e d / ) ;
82
85
} ) ;
83
86
84
87
test ( 'throws when entry does not exist' , ( ) => {
85
88
expect ( ( ) => new PythonFunction ( stack , 'Fn' , {
86
89
entry : 'notfound' ,
90
+ runtime : Runtime . PYTHON_3_8 ,
87
91
} ) ) . toThrow ( / C a n n o t f i n d i n d e x f i l e a t / ) ;
88
92
} ) ;
89
93
@@ -99,27 +103,31 @@ test('allows specifying hash type', () => {
99
103
entry : 'test/lambda-handler-nodeps' ,
100
104
index : 'index.py' ,
101
105
handler : 'handler' ,
106
+ runtime : Runtime . PYTHON_3_8 ,
102
107
} ) ;
103
108
104
109
new PythonFunction ( stack , 'source2' , {
105
110
entry : 'test/lambda-handler-nodeps' ,
106
111
index : 'index.py' ,
107
112
handler : 'handler' ,
108
113
assetHashType : AssetHashType . SOURCE ,
114
+ runtime : Runtime . PYTHON_3_8 ,
109
115
} ) ;
110
116
111
117
new PythonFunction ( stack , 'output' , {
112
118
entry : 'test/lambda-handler-nodeps' ,
113
119
index : 'index.py' ,
114
120
handler : 'handler' ,
115
121
assetHashType : AssetHashType . OUTPUT ,
122
+ runtime : Runtime . PYTHON_3_8 ,
116
123
} ) ;
117
124
118
125
new PythonFunction ( stack , 'custom' , {
119
126
entry : 'test/lambda-handler-nodeps' ,
120
127
index : 'index.py' ,
121
128
handler : 'handler' ,
122
129
assetHash : 'MY_CUSTOM_HASH' ,
130
+ runtime : Runtime . PYTHON_3_8 ,
123
131
} ) ;
124
132
125
133
Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::Lambda::Function' , {
0 commit comments