tests: Serve index.html files in webserver_sub.py.

This commit is contained in:
Florian Bruhin 2015-11-24 20:43:20 +01:00
parent f8668ff710
commit 93ef85ff16

View File

@ -47,6 +47,8 @@ def send_data(path):
basedir = os.path.realpath(os.path.dirname(__file__)) basedir = os.path.realpath(os.path.dirname(__file__))
data_dir = os.path.join(basedir, 'data') data_dir = os.path.join(basedir, 'data')
print(basedir) print(basedir)
if os.path.isdir(os.path.join(data_dir, path)):
path = path + '/index.html'
return flask.send_from_directory(data_dir, path) return flask.send_from_directory(data_dir, path)