Skip to content

Commit 2fd00f0

Browse files
committed
test for actual https file
1 parent 3f9d619 commit 2fd00f0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/test_real_https.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@
55
from activestorage.active import load_from_https
66

77

8+
def test_https():
9+
"""Run a true test with a https FILE."""
10+
test_file_uri = "https://esgf.ceda.ac.uk/thredds/fileServer/esg_cmip6/CMIP6/AerChemMIP/MOHC/UKESM1-0-LL/ssp370SST-lowNTCF/r1i1p1f2/Amon/cl/gn/latest/cl_Amon_UKESM1-0-LL_ssp370SST-lowNTCF_r1i1p1f2_gn_205001-209912.nc"
11+
12+
active = Active(test_file_uri, "cl", storage_type="https")
13+
active._version = 2
14+
active._method = "min"
15+
result = active[0:3, 4:6, 7:9]
16+
print("Result is", result)
17+
assert result == np.array([0.6909787], dtype="float32")
18+
19+
820
def test_https_dataset():
9-
"""Run a true test with a https dataset."""
21+
"""Run a true test with a https DATASET."""
1022
test_file_uri = "https://esgf.ceda.ac.uk/thredds/fileServer/esg_cmip6/CMIP6/AerChemMIP/MOHC/UKESM1-0-LL/ssp370SST-lowNTCF/r1i1p1f2/Amon/cl/gn/latest/cl_Amon_UKESM1-0-LL_ssp370SST-lowNTCF_r1i1p1f2_gn_205001-209912.nc"
1123
dataset = load_from_https(test_file_uri)
1224
av = dataset['cl']

0 commit comments

Comments
 (0)