Move httpbin data to data/ instead of html/.
This commit is contained in:
parent
2bfb7609ac
commit
fd264631c4
@ -1 +0,0 @@
|
||||
foo
|
@ -8,7 +8,7 @@ import pytest
|
||||
('/', '<title>httpbin(1): HTTP Client Testing Service</title>', True),
|
||||
# https://github.com/Runscope/httpbin/issues/245
|
||||
('/', 'www.google-analytics.com', False),
|
||||
('/html/hello.html', 'Hello World!', True),
|
||||
('/data/hello.txt', 'Hello World!', True),
|
||||
])
|
||||
def test_httpbin(httpbin, qtbot, path, content, expected):
|
||||
with qtbot.waitSignal(httpbin.got_new_url, raising=True, timeout=100):
|
||||
|
@ -5,11 +5,11 @@ from httpbin.core import app
|
||||
import flask
|
||||
|
||||
|
||||
@app.route('/html/<path:path>')
|
||||
def send_html(path):
|
||||
@app.route('/data/<path:path>')
|
||||
def send_data(path):
|
||||
basedir = os.path.realpath(os.path.dirname(__file__))
|
||||
print(basedir)
|
||||
return flask.send_from_directory(os.path.join(basedir, 'html'), path)
|
||||
return flask.send_from_directory(os.path.join(basedir, 'data'), path)
|
||||
|
||||
|
||||
app.run(port=int(sys.argv[1]), debug=True, use_reloader=False)
|
||||
|
Loading…
Reference in New Issue
Block a user