diff --git a/tests/unit/test_fsspec_streaming.py b/tests/unit/test_fsspec_streaming.py new file mode 100644 index 00000000..fde69812 --- /dev/null +++ b/tests/unit/test_fsspec_streaming.py @@ -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")