From ac47866c4cb8c425b99c4a30918236c90f3f2cce Mon Sep 17 00:00:00 2001 From: Sam Roeca Date: Tue, 11 Feb 2020 18:32:15 -0500 Subject: [PATCH] TypedDict: fix non-inheritance tests, add inheritance Note: tests currently failing --- test/completion/pep0484_typing.py | 43 ++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/test/completion/pep0484_typing.py b/test/completion/pep0484_typing.py index e81a443f..6472880d 100644 --- a/test/completion/pep0484_typing.py +++ b/test/completion/pep0484_typing.py @@ -510,7 +510,6 @@ class Foo(typing.TypedDict): foo: str bar: typing.List[float] an_int: int - foo #! ['foo: str'] foo #? str() @@ -525,8 +524,10 @@ def typed_dict_test_foo(arg: Foo): #? str() a_string - #? [float()] - a_list_of_strings + #? list() + a_list_of_floats + #? float() + a_list_of_floats[0] #? int() an_int @@ -558,7 +559,41 @@ Foo.set #? ['setdefault'] d.setdefaul -#? 5 ["'foo'"] +#? 5 ["'foo"] d['fo'] #? 5 ['"bar"'] d["bar"] + +class Bar(Foo): + another_variable: int + + #? int() + another_variable + #? str() + foo + #? int() + an_int + +def typed_dict_test_foo(arg: Bar): + a_string = arg['foo'] + a_list_of_floats = arg['bar'] + an_int = arg['an_int'] + another_variable = arg['another_variable'] + + #? str() + a_string + #? list() + a_list_of_floats + #? float() + a_list_of_floats[0] + #? int() + an_int + #? int() + another_variable + + #? ['isupper'] + a_string.isuppe + #? ['pop'] + a_list_of_floats.po + #? ['as_integer_ratio'] + an_int.as_integer_rati