| 1 |
from hdmf import Data, Container |
| 2 |
from hdmf.common import get_type_map, load_type_config, unload_type_config |
| 3 |
from hdmf.testing import TestCase |
| 4 |
|
| 5 |
|
| 6 |
class TestCommonTypeMap(TestCase): |
| 7 |
|
| 8 |
def test_base_types(self): |
| 9 |
tm = get_type_map() |
| 10 |
cls = tm.get_dt_container_cls('Container', 'hdmf-common') |
| 11 |
self.assertIs(cls, Container) |
| 12 |
cls = tm.get_dt_container_cls('Data', 'hdmf-common') |
| 13 |
self.assertIs(cls, Data) |
| 14 |
|
| 15 |
def test_copy_ts_config(self): |
| 16 |
path = 'tests/unit/hdmf_config.yaml' |
| 17 |
load_type_config(config_path=path) |
| 18 |
tm = get_type_map() |
| 19 |
config = {'namespaces': {'hdmf-common': {'version': '3.12.2', |
| 20 |
'data_types': {'VectorData': |
| 21 |
{'description': {'termset': 'example_test_term_set.yaml'}}, |
| 22 |
'VectorIndex': {'data': '...'}}}, 'foo_namespace': |
| 23 |
{'version': '...', 'data_types': |
| 24 |
{'ExtensionContainer': {'description': None}}}}} |
| 25 |
|
| 26 |
self.assertEqual(tm.type_config.config, config) |
| 27 |
self.assertEqual(tm.type_config.path, [path]) |
| 28 |
unload_type_config() |