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

Allow check_upload assets to use docker #323

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion datalad_dataverse/tests/test_pydataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import datetime
import json
import os
from requests import delete
from requests.auth import HTTPBasicAuth

Expand Down Expand Up @@ -140,7 +141,12 @@ def check_upload(api, dsid, fcontent, fpath, src_md5):
# TODO: seemingly discontinued between Dataverse 5.13 and 6.0?
#assert df['pidURL'] == ''
assert df['rootDataFileId'] == -1
assert df['storageIdentifier'].startswith('s3://demo-dataverse')

dv_url = os.getenv('DATAVERSE_TEST_BASEURL')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a test fixture that provides this if it is defined in the environment, and falls back on the demo instance if not:

def dataverse_instance_url(dataverse_demoinstance_url):
# use a custom instance if declared, otherwise fall back on
# standard demo instance
return environ.get("DATAVERSE_TEST_BASEURL",
dataverse_demoinstance_url)

I'll push a change into this PR.

if 'localhost' in dv_url or '127.0.0.1' in dv_url:
assert df['storageIdentifier'].startswith('local://')
else:
assert df['storageIdentifier'].startswith('s3://demo-dataverse')

# report the file ID for external use
return df['id']
Expand Down
Loading