From 01f8f8fcb9f036be2c87b8ef49449cf8ac062359 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:59:42 -0700 Subject: [PATCH] add test for base hdmfio --- tests/unit/test_container.py | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/unit/test_container.py b/tests/unit/test_container.py index dc4aa812f..35d8e480c 100644 --- a/tests/unit/test_container.py +++ b/tests/unit/test_container.py @@ -8,6 +8,7 @@ from hdmf.utils import docval from hdmf.common import DynamicTable, VectorData, DynamicTableRegion from hdmf.backends.hdf5.h5tools import HDF5IO +from hdmf.backends.io import HDMFIO class Subcontainer(Container): @@ -513,6 +514,42 @@ def test_repr_html_hdf5_dataset(self): os.remove('array_data.h5') + def test_repr_html_hdmf_io(self): + with HDF5IO('array_data.h5', mode='w') as io: + dataset = io._file.create_dataset(name='my_dataset', data=np.array([1, 2, 3, 4], dtype=np.int64)) + obj = self.ContainerWithData(data=dataset, str="hello") + + class OtherIO(HDMFIO): + + @staticmethod + def can_read(path): + pass + + def read_builder(self): + pass + + def write_builder(self, **kwargs): + pass + + def open(self): + pass + + def close(self): + pass + + obj.read_io = OtherIO() + + expected_html_table = ( + 'class="container-fields">
Data type | int64 |
---|---|
' + 'Shape | (4,) |
Array size' + ' | 32.00 bytes |