From 5e73ee6a1c0f3a63fc420bf856750b80001a5644 Mon Sep 17 00:00:00 2001 From: Jasha <8935917+Jasha10@users.noreply.github.com> Date: Fri, 4 Mar 2022 06:26:23 -0600 Subject: [PATCH] add test for is_tuple_annotation --- tests/test_utils.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_utils.py b/tests/test_utils.py index b29d16c3d..d45fb13e7 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -16,6 +16,7 @@ get_list_element_type, is_dict_annotation, is_list_annotation, + is_tuple_annotation, nullcontext, split_key, ) @@ -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", [