1
0
forked from VimPlug/jedi

Fix bytes issue with file path adding

This commit is contained in:
Dave Halter
2019-08-06 01:07:42 +02:00
parent 98a550e352
commit 3a9dc0ca2e
4 changed files with 13 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
from jedi._compatibility import force_unicode
def test_module_attributes(Script):
def_, = Script('__name__').completions()
assert def_.name == '__name__'
@@ -10,9 +13,9 @@ def test_module_attributes(Script):
def test_module__file__(Script, environment):
assert not Script('__file__').goto_definitions()
def_, = Script('__file__', path='example.py').goto_definitions()
value = def_._name._context.get_safe_value()
value = force_unicode(def_._name._context.get_safe_value())
assert value.endswith('example.py')
def_, = Script('import antigravity; antigravity.__file__').goto_definitions()
value = def_._name._context.get_safe_value()
value = force_unicode(def_._name._context.get_safe_value())
assert value.endswith('.py')