Skip to content

Commit

Permalink
Update test_cast.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed Jun 5, 2024
1 parent b93e15c commit 38ff809
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tests/test_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
from pyoload import annotate
from pyoload import typeMatch
from pyoload import AnnotationError
from pyoload import Union

assert pyoload.__version__ == "2.0.0"


@annotate
class foo:
foo = CastedAttr(dict[str, tuple[int | str]])
foo = CastedAttr(dict[str, tuple[Union[int, str]]])
bar: Cast(list[tuple[float]])
a: "str"

Expand All @@ -30,7 +31,7 @@ def __init__(self: "Any", bar: "list") -> Any:
def test_cast():
q = foo([(1, "67")])
q.foo = {1234: {"5", 16j}}
assert typeMatch(q.foo, dict[str, tuple[int | str]])
assert typeMatch(q.foo, dict[str, tuple[Union[int, str]]])
assert typeMatch(q.bar, list[tuple[float]])


Expand Down

0 comments on commit 38ff809

Please sign in to comment.