Skip to content

Commit

Permalink
added test for python app push
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordi Noguera and Rasheed Abdul-Aziz authored and Michael Fraenkel committed May 29, 2014
1 parent bf028f8 commit 06d638a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/buildpacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ var _ = Describe("Buildpacks", func() {
Expect(helpers.CurlAppRoot(appName)).To(ContainSubstring("go, world"))
})
})

Describe("python", func() {
It("makes the app reachable via its bound route", func() {
Expect(cf.Cf("push", appName, "-p", helpers.NewAssets().Python).Wait(CF_PUSH_TIMEOUT)).To(Exit(0))

Expect(helpers.CurlAppRoot(appName)).To(ContainSubstring("python, world"))
})
})
})
2 changes: 2 additions & 0 deletions assets/python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
venv
1 change: 1 addition & 0 deletions assets/python/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn server:app
7 changes: 7 additions & 0 deletions assets/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Flask==0.10.1
Jinja2==2.7.2
MarkupSafe==0.21
Werkzeug==0.9.4
gunicorn==18.0
itsdangerous==0.24
wsgiref==0.1.2
9 changes: 9 additions & 0 deletions assets/python/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
return "python, world"

if __name__ == "__main__":
app.run()
2 changes: 2 additions & 0 deletions helpers/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type Assets struct {
Node string
Java string
Go string
Python string
LoggregatorLoadGenerator string
ServiceBroker string
}
Expand All @@ -17,6 +18,7 @@ func NewAssets() Assets {
Node: "../assets/node",
Java: "../assets/java",
Go: "../assets/go",
Python: "../assets/python",
LoggregatorLoadGenerator: "../assets/loggregator-load-generator",
ServiceBroker: "../assets/service_broker",
}
Expand Down

0 comments on commit 06d638a

Please sign in to comment.