1
0
forked from VimPlug/jedi

Get closer to fixing a lot of issues with the completion for repl.

This commit is contained in:
Dave Halter
2016-05-15 14:26:10 +02:00
parent beeffd2dcd
commit cc331d62e0
6 changed files with 97 additions and 59 deletions

View File

@@ -7,6 +7,34 @@ import jedi
from jedi._compatibility import is_py33
def get_completion(source, namespace):
i = jedi.Interpreter(source, [namespace])
completions = i.completions()
assert len(completions) == 1
return completions[0]
def test_builtin_details():
import keyword
class EmptyClass:
pass
variable = EmptyClass()
def func():
pass
cls = get_completion('EmptyClass', locals())
var = get_completion('variable', locals())
f = get_completion('func', locals())
m = get_completion('keyword', locals())
assert cls.type == 'class'
assert var.type == 'instance'
assert f.type == 'function'
assert m.type == 'module'
class TestInterpreterAPI(TestCase):
def check_interpreter_complete(self, source, namespace, completions,
**kwds):