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

Fix(pydataverse tests): Adapt to behavior change in upload file #322

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
9 changes: 7 additions & 2 deletions datalad_dataverse/tests/test_pydataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ def check_duplicate_file_deposition(api, dsid, tmp_path):

response = api.upload_datafile(
identifier=dsid,
filename=tmp_path / 'nonunique1.txt'
filename=tmp_path / 'nonunique1.txt',
json_str='{}'
)
# we do not expect issues here
response.raise_for_status()
# now upload the second file with the same content
response = api.upload_datafile(
identifier=dsid,
filename=tmp_path / 'nonunique2.txt'
filename=tmp_path / 'nonunique2.txt',
json_str='{}'
)
response.raise_for_status()

Expand All @@ -109,6 +111,7 @@ def check_upload(api, dsid, fcontent, fpath, src_md5):
response = api.upload_datafile(
identifier=dsid,
filename=fpath,
json_str='{}'
)
# worked
assert response.status_code == 200
Expand Down Expand Up @@ -161,6 +164,7 @@ def test_file_removal(
response = dataverse_admin_api.upload_datafile(
identifier=dataverse_dataset,
filename=fpath,
json_str='{}'
)
# worked
assert response.status_code == 200, \
Expand All @@ -184,6 +188,7 @@ def test_file_removal(
response = dataverse_admin_api.upload_datafile(
identifier=dataverse_dataset,
filename=fpath,
json_str='{}'
)
assert response.status_code == 200, \
f"failed to upload file {response.status_code}: {response.json()}"
Loading