Skip to content

Commit b572966

Browse files
committed
Add test for async reference filesystem
1 parent 6bccdd9 commit b572966

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

fsspec/implementations/tests/test_reference.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,28 @@ def test_cat_file_ranges(m):
513513
assert fs.cat_file("d", 1, -3) == other[4:10][1:-3]
514514

515515

516+
@pytest.mark.asyncio
517+
async def test_async_cat_file_ranges():
518+
fs = fsspec.filesystem(
519+
"reference",
520+
fo={
521+
"version": 1,
522+
"refs": {
523+
"reference_time/0": [
524+
"http://noaa-nwm-retro-v2-0-pds.s3.amazonaws.com/full_physics/2017/201704010000.CHRTOUT_DOMAIN1.comp",
525+
39783,
526+
12,
527+
],
528+
},
529+
},
530+
remote_protocol="http",
531+
remote_options={"asynchronous": True},
532+
asynchronous=True,
533+
)
534+
535+
assert await fs._cat_file("reference_time/0") == b'x^K0\xa9d\x04\x00\x03\x13\x01\x0f'
536+
537+
516538
@pytest.mark.parametrize(
517539
"fo",
518540
[

0 commit comments

Comments
 (0)