mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-23 00:44:55 +03:00
Add optional options in integration tests.
This commit is contained in:
parent
1adaf37b08
commit
b0ba08ec21
@ -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
|
||||
|
||||
|
1
integration/tests/follow_redirect.exit
Normal file
1
integration/tests/follow_redirect.exit
Normal file
@ -0,0 +1 @@
|
||||
0
|
3
integration/tests/follow_redirect.hurl
Normal file
3
integration/tests/follow_redirect.hurl
Normal file
@ -0,0 +1,3 @@
|
||||
GET http://localhost:8000/follow-redirect
|
||||
HTTP/1.0 200
|
||||
```Followed redirect!```
|
1
integration/tests/follow_redirect.options
Normal file
1
integration/tests/follow_redirect.options
Normal file
@ -0,0 +1 @@
|
||||
-L --verbose
|
1
integration/tests/follow_redirect.out
Normal file
1
integration/tests/follow_redirect.out
Normal file
@ -0,0 +1 @@
|
||||
Followed redirect!
|
14
integration/tests/follow_redirect.py
Normal file
14
integration/tests/follow_redirect.py
Normal 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!'
|
Loading…
Reference in New Issue
Block a user