Skip to content

Commit bd8b617

Browse files
committed
correct test in light of this
1 parent c5f4d62 commit bd8b617

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/test_real_https.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_https():
1212
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"
1313

1414
active = Active(test_file_uri, "cl", storage_type="https")
15-
active._version = 2
15+
active._version = 1
1616
active._method = "min"
1717
result = active[0:3, 4:6, 7:9]
1818
print("Result is", result)
@@ -23,8 +23,10 @@ def test_https_reductionist():
2323
"""Run a true test with a https FILE."""
2424
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"
2525

26+
# added storage_type in request_data dict; Reductionist not liking it
27+
# E activestorage.reductionist.ReductionistError: Reductionist error: HTTP 400: {"error": {"message": "request data is not valid", "caused_by": ["Failed to deserialize the JSON body into the target type", "storage_type: unknown field `storage_type`, expected one of `source`, `bucket`, `object`, `dtype`, `byte_order`, `offset`, `size`, `shape`, `order`, `selection`, `compression`, `filters`, `missing` at line 1 column 550"]}}
2628
with pytest.raises(activestorage.reductionist.ReductionistError):
27-
active = Active(test_file_uri, "cl", storage_type="https-Reductionist")
29+
active = Active(test_file_uri, "cl")
2830
active._version = 2
2931
active._method = "min"
3032
result = active[0:3, 4:6, 7:9]
@@ -37,7 +39,7 @@ def test_https_implicit_storage():
3739
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"
3840

3941
active = Active(test_file_uri, "cl")
40-
active._version = 2
42+
active._version = 1
4143
active._method = "min"
4244
result = active[0:3, 4:6, 7:9]
4345
print("Result is", result)
@@ -51,7 +53,7 @@ def test_https_dataset():
5153
av = dataset['cl']
5254

5355
active = Active(av, storage_type="https")
54-
active._version = 2
56+
active._version = 1
5557
active._method = "min"
5658
result = active[0:3, 4:6, 7:9]
5759
print("Result is", result)
@@ -65,7 +67,7 @@ def test_https_dataset_implicit_storage():
6567
av = dataset['cl']
6668

6769
active = Active(av)
68-
active._version = 2
70+
active._version = 1
6971
active._method = "min"
7072
result = active[0:3, 4:6, 7:9]
7173
print("Result is", result)

0 commit comments

Comments
 (0)