Skip to content

Commit 3f1b8a0

Browse files
authored
Merge pull request #745 from mlcommons/scap3yvt-patch-1
Revert to correct download location
2 parents 0d278b6 + 7c555f1 commit 3f1b8a0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

testing/test_full.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
2-
import requests, zipfile, io, os, csv, random, copy, shutil, yaml, torch, pytest
2+
import gdown, zipfile, os, csv, random, copy, shutil, yaml, torch, pytest
33
import SimpleITK as sitk
44
import numpy as np
55
import pandas as pd
@@ -110,7 +110,7 @@
110110
def test_generic_download_data():
111111
print("00: Downloading the sample data")
112112
urlToDownload = (
113-
"https://upenn.box.com/shared/static/y8162xkq1zz5555ye3pwadry2m2e39bs.zip"
113+
"https://drive.google.com/uc?id=1c4Yrv-jnK6Tk7Ne1HmMTChv-4nYk43NT"
114114
)
115115

116116
files_check = [
@@ -122,11 +122,12 @@ def test_generic_download_data():
122122
for file in files_check:
123123
if not os.path.isfile(file):
124124
print("Downloading and extracting sample data")
125-
r = requests.get(urlToDownload)
126-
z = zipfile.ZipFile(io.BytesIO(r.content))
127-
z.extractall(testingDir)
125+
output = os.path.join(testingDir, "gandlf_unit_test_data.tgz")
126+
gdown.download(urlToDownload, output, quiet=False)
127+
with zipfile.ZipFile(output, "r") as zip_ref:
128+
zip_ref.extractall(testingDir)
129+
os.remove(output)
128130
break
129-
130131
sanitize_outputDir()
131132

132133
print("passed")

0 commit comments

Comments
 (0)