nwb-linkml/nwb_linkml/tests/test_annotations.py

15 lines
459 B
Python
Raw Permalink Normal View History

2024-07-02 04:44:35 +00:00
from types import NoneType
from typing import List
import pytest
from nwb_linkml.annotations import get_inner_types
2024-07-02 04:23:31 +00:00
@pytest.mark.parametrize(("annotation", "inner_types"), [(List[str | None], (str, NoneType))])
def test_get_inner_types(annotation, inner_types):
got_inner_types = get_inner_types(annotation)
assert len(got_inner_types) == len(inner_types)
for got, expected in zip(got_inner_types, inner_types):
2024-07-02 04:23:31 +00:00
assert got is expected