mirror of
https://github.com/p2p-ld/nwb-linkml.git
synced 2024-11-14 10:44:28 +00:00
17 lines
513 B
Python
17 lines
513 B
Python
|
import pytest
|
||
|
|
||
|
from typing import List, Optional, Union
|
||
|
from types import NoneType
|
||
|
from nwb_linkml.annotations import get_inner_types
|
||
|
|
||
|
@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):
|
||
|
assert got is expected
|