Add optional options in integration tests.

This commit is contained in:
jcamiel 2020-09-14 15:19:26 +02:00
parent 1adaf37b08
commit b0ba08ec21
6 changed files with 30 additions and 2 deletions

View File

@ -3,9 +3,17 @@ set -u
set -e
for hurl_file in "$@"; do
echo "$hurl_file";
set +e
hurl "$hurl_file" --color 2>/tmp/test.stderr >/tmp/test.stdout
options=("--color")
if test -f "${hurl_file%.*}.options"; then
options+=("$(cat "${hurl_file%.*}.options")")
fi
cmd="hurl $hurl_file ${options[@]}"
echo "$cmd"
$cmd 2>/tmp/test.stderr >/tmp/test.stdout
EXITCODE_ACTUAL=$?
set -e

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,3 @@
GET http://localhost:8000/follow-redirect
HTTP/1.0 200
```Followed redirect!```

View File

@ -0,0 +1 @@
-L --verbose

View File

@ -0,0 +1 @@
Followed redirect!

View File

@ -0,0 +1,14 @@
from tests import app
from flask import redirect
@app.route('/follow-redirect')
def follow_redirect():
return redirect('http://localhost:8000/following-redirect')
@app.route('/following-redirect')
def following_redirect():
return redirect('http://localhost:8000/followed-redirect')
@app.route('/followed-redirect')
def followed_redirect():
return 'Followed redirect!'