Skip to content

Commit

Permalink
Use dataverse_instance_url fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
adswa committed Aug 23, 2024
1 parent 372989a commit 3251cf2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions datalad_dataverse/tests/test_pydataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

Expand All @@ -26,6 +25,7 @@ def test_file_handling(
dataverse_admin_api,
dataverse_dataaccess_api,
dataverse_dataset,
dataverse_instance_url,
):
# the starting point of `dataverse_dataset` is a freshly
# created, non-published dataset in draft mode, with no prior
Expand All @@ -42,7 +42,7 @@ def test_file_handling(

fileid = check_upload(
dataverse_admin_api,
dataverse_dataset, fcontent, fpath, src_md5)
dataverse_dataset, fcontent, fpath, src_md5, dataverse_instance_url)

check_download(
dataverse_dataaccess_api, fileid,
Expand Down Expand Up @@ -105,7 +105,7 @@ def check_duplicate_file_deposition(api, dsid, tmp_path):
for f in identicals)


def check_upload(api, dsid, fcontent, fpath, src_md5):
def check_upload(api, dsid, fcontent, fpath, src_md5, dv_url):
# the simplest possible upload, just a source file name
response = api.upload_datafile(
identifier=dsid,
Expand Down Expand Up @@ -142,7 +142,6 @@ def check_upload(api, dsid, fcontent, fpath, src_md5):
#assert df['pidURL'] == ''
assert df['rootDataFileId'] == -1

dv_url = os.getenv('DATAVERSE_TEST_BASEURL')
if 'localhost' in dv_url or '127.0.0.1' in dv_url:
assert df['storageIdentifier'].startswith('local://')
else:
Expand Down

0 comments on commit 3251cf2

Please sign in to comment.