mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2025-01-04 17:41:45 +03:00
Merge pull request #79 from Orange-OpenSource/feature/test-integ-max-redirect
Add test integ max-redirect
This commit is contained in:
commit
f2a742d9b1
7
integration/tests/error_max_redirect.err
Normal file
7
integration/tests/error_max_redirect.err
Normal file
@ -0,0 +1,7 @@
|
||||
error: Http Connection
|
||||
--> tests/error_max_redirect.hurl:1:5
|
||||
|
|
||||
1 | GET http://localhost:8000/redirect/7
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Too many redirect
|
||||
|
|
||||
|
2
integration/tests/error_max_redirect.exit
Normal file
2
integration/tests/error_max_redirect.exit
Normal file
@ -0,0 +1,2 @@
|
||||
3
|
||||
|
1
integration/tests/error_max_redirect.html
Normal file
1
integration/tests/error_max_redirect.html
Normal file
@ -0,0 +1 @@
|
||||
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="string">http://localhost:8000/redirect/7</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div></div>
|
4
integration/tests/error_max_redirect.hurl
Normal file
4
integration/tests/error_max_redirect.hurl
Normal file
@ -0,0 +1,4 @@
|
||||
GET http://localhost:8000/redirect/7
|
||||
HTTP/1.0 200
|
||||
|
||||
|
1
integration/tests/error_max_redirect.json
Normal file
1
integration/tests/error_max_redirect.json
Normal file
@ -0,0 +1 @@
|
||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/redirect/7"},"response":{"version":"HTTP/1.0","status":200}}]}
|
2
integration/tests/error_max_redirect.options
Normal file
2
integration/tests/error_max_redirect.options
Normal file
@ -0,0 +1,2 @@
|
||||
--location --max-redirs 5
|
||||
|
11
integration/tests/error_max_redirect.py
Normal file
11
integration/tests/error_max_redirect.py
Normal file
@ -0,0 +1,11 @@
|
||||
from tests import app
|
||||
from flask import redirect
|
||||
|
||||
@app.route('/redirect/<number>', methods=['GET'])
|
||||
def redirect_n(number):
|
||||
n = int(number)
|
||||
if n == 0:
|
||||
return ''
|
||||
return redirect('http://localhost:8000/redirect/' + str(n-1))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user