Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test upload filenames with fwdslash #1076

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tests/integration_tests/python/test_uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def test_label_upload(data_builder, file_form, as_admin):

# label-upload files
r = as_admin.post('/upload/label', files=file_form(
'project.csv', 'subject.csv', 'session.csv', 'acquisition.csv', 'unused.csv',
'project.csv', 'subject.csv', 'session.csv', 'b\acquisition.csv', 'unused.csv',
meta={
'group': {'_id': group},
'project': {
Expand All @@ -521,11 +521,13 @@ def test_label_upload(data_builder, file_form, as_admin):
},
'acquisition': {
'label': 'test_acquisition_label',
'files': [{'name': 'acquisition.csv'}]
'files': [{'name': 'b\acquisition.csv'}]
}
})
)
assert r.ok
assert len(r.json()) == 4
assert r.json()[3].get('name') == "b\acquisition.csv"

# delete group and children recursively (created by upload)
data_builder.delete_group(group, recursive=True)
Expand Down Expand Up @@ -686,7 +688,7 @@ def test_acquisition_engine_upload(data_builder, file_form, as_root):
'info': {'test': 'f0'}
},
{
'name': 'two.csv',
'name': 'b\two.csv',
'type': 'engine type 1',
'info': {'test': 'f1'}
}
Expand All @@ -697,14 +699,14 @@ def test_acquisition_engine_upload(data_builder, file_form, as_root):
# try engine upload w/ non-existent job_id
r = as_root.post('/engine',
params={'level': 'acquisition', 'id': acquisition, 'job': '000000000000000000000000'},
files=file_form('one.csv', 'two.csv', meta=metadata)
files=file_form('one.csv', 'b\two.csv', meta=metadata)
)
assert r.status_code == 404

# engine upload
r = as_root.post('/engine',
params={'level': 'acquisition', 'id': acquisition, 'job': job},
files=file_form('one.csv', 'two.csv', meta=metadata)
files=file_form('one.csv', 'b\two.csv', meta=metadata)
)
assert r.ok

Expand Down