Skip to content

Commit 43e1404

Browse files
committed
test for #161
1 parent 8783049 commit 43e1404

File tree

7 files changed

+681
-0
lines changed

7 files changed

+681
-0
lines changed

test.bats

+8
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,11 @@ teardown() {
217217
ls puck/flask
218218
ls puck/lambda_decorators.py
219219
}
220+
221+
@test "issue 161 doesn't happen" {
222+
cd tests/issue-161
223+
npm i $(npm pack ../..)
224+
sls package
225+
unzip .serverless/myService.zip -d puck
226+
ls puck/flask
227+
}

tests/issue-161/.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Distribution / packaging
2+
.Python
3+
env/
4+
build/
5+
develop-eggs/
6+
dist/
7+
downloads/
8+
eggs/
9+
.eggs/
10+
lib/
11+
lib64/
12+
parts/
13+
sdist/
14+
var/
15+
*.egg-info/
16+
.installed.cfg
17+
*.egg
18+
19+
# Serverless directories
20+
.serverless
21+
.requirements
22+
23+
# Project ignores
24+
puck/
25+
serverless.yml.bak

tests/issue-161/handler.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import requests
2+
3+
4+
def hello(event, context):
5+
return requests.get('https://httpbin.org/get').json()

tests/issue-161/package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"serverless-python-requirements": "file:.."
13+
}
14+
}

tests/issue-161/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
flask
2+
bottle
3+
boto3

tests/issue-161/serverless.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# serverless.yml
2+
service: myService
3+
4+
provider:
5+
name: aws
6+
runtime: python2.7
7+
8+
plugins:
9+
- serverless-python-requirements
10+
11+
custom:
12+
pythonRequirements:
13+
dockerizePip: true
14+
15+
functions:
16+
hello:
17+
handler: handler.hello

0 commit comments

Comments
 (0)