Skip to content

Commit 3c3325f

Browse files
committed
add dedicated https test module
1 parent 42c5cd4 commit 3c3325f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_real_https.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
import numpy as np
3+
4+
from activestorage.active import Active
5+
from activestorage.active import load_from_https
6+
7+
8+
def test_https_dataset():
9+
"""Run a true test with a https dataset."""
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+
dataset = load_from_https(test_file_uri)
12+
av = dataset['cl']
13+
14+
active = Active(av, storage_type="https")
15+
active._version = 2
16+
active._method = "min"
17+
result = active[0:3, 4:6, 7:9]
18+
print("Result is", result)
19+
assert result == 5098.625

0 commit comments

Comments
 (0)