Move httpbin data to data/ instead of html/.

This commit is contained in:
Florian Bruhin 2015-09-17 07:45:12 +02:00
parent 2bfb7609ac
commit fd264631c4
3 changed files with 4 additions and 5 deletions

View File

@ -1 +0,0 @@
foo

View File

@ -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):

View File

@ -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)