nwb-linkml/nwb_schema_language/tests/test_data.py

23 lines
645 B
Python
Raw Normal View History

2023-08-16 23:07:36 +00:00
"""Data test."""
import os
import glob
import unittest
from linkml_runtime.loaders import yaml_loader
from nwb_schema_language.datamodel.nwb_schema_language import Namespaces
ROOT = os.path.join(os.path.dirname(__file__), '..')
2023-08-17 06:47:35 +00:00
DATA_DIR = os.path.join(ROOT, "src", "data", "tests")
2023-08-16 23:07:36 +00:00
EXAMPLE_FILES = glob.glob(os.path.join(DATA_DIR, '*.yaml'))
class TestData(unittest.TestCase):
"""Test data and datamodel."""
2023-08-17 06:47:35 +00:00
def test_namespaces(self):
2023-08-16 23:07:36 +00:00
"""Date test."""
2023-08-17 06:47:35 +00:00
namespace_file = [f for f in EXAMPLE_FILES if 'namespace.yaml' in f][0]
obj = yaml_loader.load(namespace_file, target_class=Namespaces)
assert obj