Skip to content

Commit cc631f1

Browse files
committed
updates tests
1 parent 1be221c commit cc631f1

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

xarray/tests/test_backends.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6563,8 +6563,7 @@ def test_session(self) -> None:
65636563
@requires_pydap
65646564
@network
65656565
@pytest.mark.parametrize("protocol", ["dap2", "dap4"])
6566-
@pytest.mark.parametrize("batch", [False, True])
6567-
def test_batchdap4_downloads(tmpdir, protocol, batch) -> None:
6566+
def test_batchdap4_downloads(tmpdir, protocol) -> None:
65686567
"""Test that in dap4, all dimensions are downloaded at once"""
65696568
import pydap
65706569
from pydap.net import create_session
@@ -6576,39 +6575,28 @@ def test_batchdap4_downloads(tmpdir, protocol, batch) -> None:
65766575
session.cache.clear()
65776576
url = "https://test.opendap.org/opendap/hyrax/data/nc/coads_climatology.nc"
65786577

6578+
ds = open_dataset(
6579+
url.replace("https", protocol),
6580+
session=session,
6581+
engine="pydap",
6582+
decode_times=False,
6583+
)
6584+
65796585
if protocol == "dap4":
6580-
ds = open_dataset(
6581-
url.replace("https", protocol),
6582-
engine="pydap",
6583-
session=session,
6584-
decode_times=False,
6585-
batch=batch,
6586-
)
65876586
if _version_ > Version("3.5.5"):
65886587
# total downloads are:
6589-
# 1 dmr + 1 dap (dimensions)
6588+
# 1 dmr + 1 dap (all dimensions at once)
65906589
assert len(session.cache.urls()) == 2
65916590
# now load the rest of the variables
65926591
ds.load()
6593-
if batch:
6594-
# all non-dimensions are downloaded in a single https requests
6595-
assert len(session.cache.urls()) == 2 + 1
6596-
if not batch:
6597-
# each non-dimension array is downloaded with an individual
6598-
# https requests
6599-
assert len(session.cache.urls()) == 2 + 4
6592+
# each non-dimension array is downloaded with an individual https requests
6593+
assert len(session.cache.urls()) == 2 + 4
66006594
else:
66016595
assert len(session.cache.urls()) == 4
66026596
ds.load()
66036597
assert len(session.cache.urls()) == 4 + 4
66046598
elif protocol == "dap2":
6605-
ds = open_dataset(
6606-
url.replace("https", protocol),
6607-
engine="pydap",
6608-
session=session,
6609-
decode_times=False,
6610-
)
6611-
# das + dds + 3 dods urls
6599+
# das + dds + 3 dods urls for dimensions alone
66126600
assert len(session.cache.urls()) == 5
66136601

66146602

0 commit comments

Comments
 (0)