1
0
forked from VimPlug/jedi

Merge pull request #228 from tkf/fix-full_name

Fix full_name for import statements
This commit is contained in:
David Halter
2013-05-21 09:11:15 -07:00
3 changed files with 103 additions and 23 deletions

View File

@@ -16,7 +16,6 @@ from .base import TestBase, unittest, cwd_at
import jedi
from jedi._compatibility import utf8, unicode, is_py33
from jedi import api, parsing, common
api_classes = api.api_classes
#jedi.set_debug_function(jedi.debug.print_to_stdout)
@@ -417,28 +416,6 @@ class TestDocstring(TestBase):
class TestFeature(TestBase):
def test_full_name(self):
""" feature request #61"""
assert self.completions('import os; os.path.join')[0].full_name \
== 'os.path.join'
def test_keyword_full_name_should_be_none(self):
"""issue #94"""
# Using `from jedi.keywords import Keyword` here does NOT work
# in Python 3. This is due to the import hack jedi using.
Keyword = api_classes.keywords.Keyword
d = api_classes.Definition(Keyword('(', (0, 0)))
assert d.full_name is None
def test_full_name_builtin(self):
self.assertEqual(self.completions('type')[0].full_name, 'type')
def test_full_name_tuple_mapping(self):
s = """
import re
any_re = re.compile('.*')
any_re"""
self.assertEqual(self.goto_definitions(s)[0].full_name, 're.RegexObject')
def test_preload_modules(self):
def check_loaded(*modules):