def test_file_selection_post(self, client, vis, random_image_files):
with client.session_transaction() as sess:
sess['vis_name'] = vis.__name__
# load some settings into the session if the visualization calls
# for it
if hasattr(vis, 'settings'):
sess['settings'] = {key: vis.settings[key][0]
for key in vis.settings}
# random images
builder = EnvironBuilder(path=url_for('select_files'), method='POST')
for path in random_image_files.listdir():
path = str(path)
builder.files.add_file('file[]', path,
filename=os.path.split(str(path))[-1])
rv = client.post(url_for('select_files'), data=builder.files)
assert rv.status_code == 200
评论列表
文章目录