Skip to content

Commit

Permalink
Add test for async reference filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci committed Oct 23, 2024
1 parent 6bccdd9 commit b572966
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions fsspec/implementations/tests/test_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,28 @@ def test_cat_file_ranges(m):
assert fs.cat_file("d", 1, -3) == other[4:10][1:-3]


@pytest.mark.asyncio
async def test_async_cat_file_ranges():
fs = fsspec.filesystem(
"reference",
fo={
"version": 1,
"refs": {
"reference_time/0": [
"http://noaa-nwm-retro-v2-0-pds.s3.amazonaws.com/full_physics/2017/201704010000.CHRTOUT_DOMAIN1.comp",
39783,
12,
],
},
},
remote_protocol="http",
remote_options={"asynchronous": True},
asynchronous=True,
)

assert await fs._cat_file("reference_time/0") == b'x^K0\xa9d\x04\x00\x03\x13\x01\x0f'


@pytest.mark.parametrize(
"fo",
[
Expand Down

0 comments on commit b572966

Please sign in to comment.