user_statement problems with imports and brackets, test for #285

This commit is contained in:
David Halter
2013-08-11 01:12:08 +04:30
parent 66fa0b0575
commit ec347dd975

13
test/test_parsing.py Normal file
View File

@@ -0,0 +1,13 @@
from jedi import parsing
from jedi import parsing_representation as pr
def test_user_statement_on_import():
"""github #285"""
s = "from datetime import (\n" \
" time)"
for pos in [(2, 1), (2, 4)]:
u = parsing.Parser(s, user_position=pos).user_stmt
assert isinstance(u, pr.Import)
assert u.defunct == False
assert [str(n) for n in u.get_defined_names()] == ['time']