added import tests

This commit is contained in:
David Halter
2012-04-21 23:08:13 +02:00
parent dccef451a2
commit 1af8273389
6 changed files with 31 additions and 11 deletions

View File

@@ -58,8 +58,6 @@ class FileWithCursor(modules.File):
close_brackets = [')', ']', '}']
gen = tokenize.generate_tokens(fetch_line)
# TODO can happen: raise TokenError, ("EOF in multi-line statement"
# where???
string = ''
level = 0
for token_type, tok, start, end, line in gen:
@@ -199,6 +197,9 @@ def complete(source, row, column, source_path):
for s in scopes:
completions += s.get_defined_names()
# remove duplicates
completions = list(set(completions))
needs_dot = not dot and path
completions = [Completion(c, needs_dot, len(like)) for c in completions
if c.names[-1].lower().startswith(like.lower())]