Skip to content

Commit 6f7b229

Browse files
committed
Add test case for non-Python runtimes
1 parent a20a209 commit 6f7b229

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

test.bats

+14
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,20 @@ teardown() {
396396
ls puck2/.requirements.zip puck2/unzip_requirements.py
397397
}
398398

399+
@test "py2.7 can package only python runtimes" {
400+
cd tests/individually
401+
npm i $(npm pack ../..)
402+
sls --runtime=python2.7 package
403+
unzip .serverless/module1-sls-py-req-test-indiv-dev-hello1.zip -d puck
404+
unzip .serverless/module2-sls-py-req-test-indiv-dev-hello2.zip -d puck2
405+
unzip .serverless/hello3.zip -d puck3
406+
ls puck3/module3/handler3.js
407+
! ls puck/handler3.js
408+
! ls puck2/handler3.js
409+
! ls puck3/flask
410+
! ls puck3/pyaml
411+
}
412+
399413
@test "py3.6 can package lambda-decorators using vendor option" {
400414
cd tests/base
401415
npm i $(npm pack ../..)
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exports.hello = function(event, context, callback) {
2+
callback(null, { status: 200 })
3+
};

tests/individually/serverless.yml

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ functions:
2020
hello2:
2121
handler: handler2.hello
2222
module: module2
23+
hello3:
24+
handler: module3/handler3.hello
25+
runtime: node6.10
26+
package:
27+
exclude:
28+
- '**/*'
29+
include:
30+
- 'module3/**/*'
2331

2432
plugins:
2533
- serverless-python-requirements

0 commit comments

Comments
 (0)