1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
from unittest import TestCase
import pynwb
class TestImportStructure(TestCase):
"""Test whether the classes/modules imported from pynwb in version 2.1.1 are still accessible.
NOTE: this test was needed to ensure backward compatibility of "import pynwb" after changes to the package file
hierarchy in PyNWB 2.2.0 around validate.py (see https://github.com/NeurodataWithoutBorders/pynwb/pull/1511).
"""
def test_outer_import_structure(self):
current_structure = dir(pynwb)
expected_structure = [
"BuildManager",
"CORE_NAMESPACE",
"DataChunkIterator",
"H5DataIO",
"HDMFIO",
"NWBContainer",
"NWBData",
"NWBDatasetSpec",
"NWBFile",
"NWBGroupSpec",
"NWBHDF5IO",
"NWBNamespace",
"NamespaceCatalog",
"Path",
"ProcessingModule",
"TimeSeries",
"TypeMap",
"_HDF5IO",
"__NS_CATALOG",
"__TYPE_MAP",
"__builtins__",
"__cached__",
"__doc__",
"__file__",
"__get_resources",
"__io",
"__loader__",
"__name__",
"__package__",
"__path__",
"__resources",
"__spec__",
"__version__",
"_due",
"_get_resources",
"_version",
"available_namespaces",
"base",
"behavior",
"core",
"deepcopy",
"device",
"docval",
"ecephys",
"epoch",
"file",
"get_class",
"get_docval",
"get_manager",
"get_type_map",
"getargs",
"h5py",
"hdmf",
"hdmf_typemap",
"icephys",
"image",
"io",
"legacy",
"load_namespaces",
"misc",
"ogen",
"ophys",
"os",
"popargs",
"register_class",
"register_map",
"spec",
"testing",
"validate",
]
for member in expected_structure:
self.assertIn(member=member, container=current_structure)
|