[config] test python buildpack too
This commit is contained in:
@@ -1,2 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "python/flask"
|
||||
set -e;
|
||||
base_url=$1
|
||||
test_url () {
|
||||
path="$1"
|
||||
expected_output="$2"
|
||||
url="${base_url}${path}"
|
||||
output="$(curl -s -S "$url")"
|
||||
echo "$url -> $output"
|
||||
test "$output" == "$expected_output"
|
||||
}
|
||||
|
||||
base_url="$1"
|
||||
test_url / "python/flask"
|
||||
test_url /HELLO "Hello
|
||||
'world' "
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
import os
|
||||
from flask import Flask
|
||||
from flask import Flask, abort
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
def hello():
|
||||
return 'python/flask'
|
||||
|
||||
@app.route('/<env>')
|
||||
def get_enc(env):
|
||||
val = os.environ.get(env, None)
|
||||
if val:
|
||||
return val
|
||||
else:
|
||||
abort(404)
|
||||
|
||||
|
||||
|
||||
9
tests/apps/python-flask/post-deploy
Executable file
9
tests/apps/python-flask/post-deploy
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex;
|
||||
|
||||
REMOTE=$1
|
||||
REPO=$2
|
||||
|
||||
GREETING=$(printf "Hello
|
||||
'world' " | base64)
|
||||
ssh "$REMOTE" config:set --encoded "$REPO" HELLO="$GREETING"
|
||||
Reference in New Issue
Block a user