Skip to content

Commit

Permalink
Add streaming test (currently very slow)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Nov 10, 2023
1 parent c687f76 commit ffc081f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/unit/test_fsspec_streaming.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest


try:
import s3fs
import fsspec
HAVE_FSSPEC = True
except ImportError:
HAVE_FSSPEC = False


from hdmf_zarr import NWBZarrIO


class TestFSSpecStreaming(unittest.TestCase):

@unittest.skipIf(not HAVE_FSSPEC, "fsspec not installed")
def test_fsspec_streaming(self):
# PLACEHOLDER test file from Allen Insitute for Neural Dynamics
# TODO: store a small test file and use it to speed up testing
remote_path = "s3://aind-open-data/ecephys_625749_2022-08-03_15-15-06_nwb_2023-05-16_16-34-55/ecephys_625749_2022-08-03_15-15-06_nwb/ecephys_625749_2022-08-03_15-15-06_experiment1_recording1.nwb.zarr/"

with NWBZarrIO(remote_path, "r") as io:
nwbfile = io.read()

self.assertEqual(nwbfile.identifier, "ecephys_625749_2022-08-03_15-15-06")
self.assertEqual(len(nwbfile.devices), 2)
self.assertEqual(len(nwbfile.electrode_groups), 2)
self.assertEqual(len(nwbfile.electrodes), 1152)
self.assertEqual(nwbfile.institution, "AIND")

0 comments on commit ffc081f

Please sign in to comment.