Skip to content

Commit

Permalink
add test for is_tuple_annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasha10 committed Mar 4, 2022
1 parent 4d4efc2 commit 5e73ee6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
get_list_element_type,
is_dict_annotation,
is_list_annotation,
is_tuple_annotation,
nullcontext,
split_key,
)
Expand Down Expand Up @@ -482,6 +483,29 @@ def test_is_list_annotation(type_: Any, expected: Any) -> Any:
assert is_list_annotation(type_=type_) == expected


@mark.parametrize(
"type_, expected",
[
(Tuple[int], True),
(Tuple[float], True),
(Tuple[bool], True),
(Tuple[str], True),
(Tuple[Color], True),
(Tuple[Plugin], True),
(Tuple[IllegalType], True),
(Dict, False),
(List, False),
(Tuple, True),
(Tuple, True),
(list, False),
(dict, False),
(tuple, False),
],
)
def test_is_tuple_annotation(type_: Any, expected: Any) -> Any:
assert is_tuple_annotation(type_=type_) == expected


@mark.parametrize(
"obj, expected",
[
Expand Down

0 comments on commit 5e73ee6

Please sign in to comment.