mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-10 05:52:22 +08:00
context -> value
This commit is contained in:
@@ -398,7 +398,7 @@ def test_import_alias(names):
|
||||
n = nms[0].goto_assignments()[0]
|
||||
assert n.name == 'json'
|
||||
assert n.type == 'module'
|
||||
assert n._name._context.tree_node.type == 'file_input'
|
||||
assert n._name._value.tree_node.type == 'file_input'
|
||||
|
||||
assert nms[1].name == 'foo'
|
||||
assert nms[1].type == 'module'
|
||||
@@ -407,7 +407,7 @@ def test_import_alias(names):
|
||||
assert len(ass) == 1
|
||||
assert ass[0].name == 'json'
|
||||
assert ass[0].type == 'module'
|
||||
assert ass[0]._name._context.tree_node.type == 'file_input'
|
||||
assert ass[0]._name._value.tree_node.type == 'file_input'
|
||||
|
||||
|
||||
def test_added_equals_to_params(Script):
|
||||
|
||||
@@ -34,7 +34,7 @@ def test_in_empty_space(Script):
|
||||
assert def_.name == 'X'
|
||||
|
||||
|
||||
def test_indent_context(Script):
|
||||
def test_indent_value(Script):
|
||||
"""
|
||||
If an INDENT is the next supposed token, we should still be able to
|
||||
complete.
|
||||
@@ -44,7 +44,7 @@ def test_indent_context(Script):
|
||||
assert comp.name == 'isinstance'
|
||||
|
||||
|
||||
def test_keyword_context(Script):
|
||||
def test_keyword_value(Script):
|
||||
def get_names(*args, **kwargs):
|
||||
return [d.name for d in Script(*args, **kwargs).completions()]
|
||||
|
||||
@@ -101,8 +101,8 @@ def test_fake_subnodes(Script):
|
||||
for i in range(2):
|
||||
completions = Script('').completions()
|
||||
c = get_str_completion(completions)
|
||||
str_context, = c._name.infer()
|
||||
n = len(str_context.tree_node.children[-1].children)
|
||||
str_value, = c._name.infer()
|
||||
n = len(str_value.tree_node.children[-1].children)
|
||||
if i == 0:
|
||||
limit = n
|
||||
else:
|
||||
|
||||
@@ -7,7 +7,7 @@ import pytest
|
||||
|
||||
import jedi
|
||||
from jedi._compatibility import is_py3, py_version
|
||||
from jedi.inference.compiled import mixed, context
|
||||
from jedi.inference.compiled import mixed, value
|
||||
from importlib import import_module
|
||||
|
||||
if py_version > 30:
|
||||
@@ -101,8 +101,8 @@ def test_side_effect_completion():
|
||||
side_effect = get_completion('SideEffectContainer', _GlobalNameSpace.__dict__)
|
||||
|
||||
# It's a class that contains MixedObject.
|
||||
context, = side_effect._name.infer()
|
||||
assert isinstance(context, mixed.MixedObject)
|
||||
value, = side_effect._name.infer()
|
||||
assert isinstance(value, mixed.MixedObject)
|
||||
foo = get_completion('SideEffectContainer.foo', _GlobalNameSpace.__dict__)
|
||||
assert foo.name == 'foo'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user