From cf954bf0068b3e0b70d0962f87e8e1ac1a751de1 Mon Sep 17 00:00:00 2001 From: Sam Roeca Date: Fri, 7 Feb 2020 14:40:39 -0500 Subject: [PATCH] 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. --- test/completion/pep0484_typing.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/completion/pep0484_typing.py b/test/completion/pep0484_typing.py index eef0bf13..e81a443f 100644 --- a/test/completion/pep0484_typing.py +++ b/test/completion/pep0484_typing.py @@ -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