Skip to content

Commit 32e2c48

Browse files
committed
Additional test cases for AnnotationTemplate
1 parent d934eff commit 32e2c48

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Union, Optional, Callable, Iterable, Sized
1+
from typing import Any, Union, Optional, Callable, Iterable, Literal, Sized
22

33
from pytest import mark
44

@@ -58,6 +58,27 @@ def test_input_annotation_annotation_grouping(type_to_group: type):
5858
str,
5959
Callable[[str], Optional[str]]
6060
),
61+
(
62+
AnnotationTemplate(
63+
Callable,
64+
[[AnnotationTemplate(Iterable, [input_annotation])], Any]
65+
),
66+
int,
67+
Callable[[Iterable[int]], Any]
68+
),
69+
(
70+
AnnotationTemplate(
71+
Callable,
72+
[[AnnotationTemplate(Iterable, [input_annotation])], Iterable[int]]
73+
),
74+
int,
75+
Callable[[Iterable[int]], Iterable[int]]
76+
),
77+
(
78+
AnnotationTemplate(Iterable, [input_annotation | Ellipsis]),
79+
Literal[256],
80+
Iterable[Literal[256] | Ellipsis]
81+
),
6182
]
6283
)
6384
def test_annotation_template(annotation_template: AnnotationTemplate, input_resource: Any, result: Any):

0 commit comments

Comments
 (0)