Expand on TypedDict tests.

Adds a function that takes the TypedDict as an argument.

Note: the last two tests are failing, along with lots of other tests
throughout the system.
This commit is contained in:
Sam Roeca
2020-02-07 14:40:39 -05:00
parent 9d2083fa08
commit cf954bf006

View File

@@ -509,11 +509,33 @@ dynamic_annotation('')
class Foo(typing.TypedDict):
foo: str
bar: typing.List[float]
an_int: int
foo
#! ['foo: str']
foo
#? str()
foo
#? int()
an_int
def typed_dict_test_foo(arg: Foo):
a_string = arg['foo']
a_list_of_floats = arg['bar']
an_int = arg['an_int']
#? str()
a_string
#? [float()]
a_list_of_strings
#? int()
an_int
#? ['isupper']
a_string.isuppe
#? ['pop']
a_list_of_floats.po
#? ['as_integer_ratio']
an_int.as_integer_rati
#! ['class Foo']
d: Foo