nwb-linkml/nwb_schema_language/tests/test_data.py

24 lines
646 B
Python
Raw Permalink Normal View History

2023-08-16 23:07:36 +00:00
"""Data test."""
2024-07-02 04:23:31 +00:00
2023-08-16 23:07:36 +00:00
import os
import glob
import unittest
from linkml_runtime.loaders import yaml_loader
from nwb_schema_language.datamodel.nwb_schema_language import Namespaces
2024-07-02 04:23:31 +00:00
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
2024-07-02 04:23:31 +00:00
EXAMPLE_FILES = glob.glob(os.path.join(DATA_DIR, "*.yaml"))
2023-08-16 23:07:36 +00:00
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."""
2024-07-02 04:23:31 +00:00
namespace_file = [f for f in EXAMPLE_FILES if "namespace.yaml" in f][0]
2023-08-17 06:47:35 +00:00
obj = yaml_loader.load(namespace_file, target_class=Namespaces)
assert obj