Commit 45cf1a7 1 parent 9ef3e4d commit 45cf1a7 Copy full SHA for 45cf1a7
File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,34 @@ def test_https_implicit_storage():
59
59
assert result == np .array ([0.6909787 ], dtype = "float32" )
60
60
61
61
62
+ def test_https_implicit_storage_file_not_found ():
63
+ """
64
+ Run a true test with a https FILE that is not found.
65
+ Code raises a very descriptive exception via fsspec.
66
+ Keep test to capture any changes in behaviour.
67
+ """
68
+ 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.ncx"
69
+
70
+ with pytest .raises (FileNotFoundError ):
71
+ active = Active (test_file_uri , "cl" )
72
+ active ._version = 1
73
+ active ._method = "min"
74
+ result = active [0 :3 , 4 :6 , 7 :9 ]
75
+
76
+
77
+ def test_https_implicit_storage_wrong_url ():
78
+ """
79
+ Run a true test with a bogus URL.
80
+ """
81
+ test_file_uri = "https://esgf.cedacow.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"
82
+
83
+ with pytest .raises (ValueError ):
84
+ active = Active (test_file_uri , "cl" )
85
+ active ._version = 1
86
+ active ._method = "min"
87
+ result = active [0 :3 , 4 :6 , 7 :9 ]
88
+
89
+
62
90
@pytest .mark .skip (reason = "save time: test_https_dataset_implicit_storage is more general." )
63
91
def test_https_dataset ():
64
92
"""Run a true test with a https DATASET."""
You can’t perform that action at this time.
0 commit comments