1
0
forked from VimPlug/jedi

Small full_name improvements.

This commit is contained in:
Dave Halter
2014-12-08 12:38:59 +01:00
parent 8868b87d42
commit 7cc2a07cd3
2 changed files with 7 additions and 8 deletions

View File

@@ -27,16 +27,14 @@ class MixinTestFullName(object):
def check(self, source, desired):
script = jedi.Script(textwrap.dedent(source))
definitions = getattr(script, type(self).operation)()
assert len(definitions) == 1
self.assertEqual(definitions[0].full_name, desired)
def test_os_path_join(self):
self.check('import os; os.path.join', 'os.path.join')
def test_builtin(self):
self.check('type', 'type')
def test_from_import(self):
self.check('from os import path', 'os.path')
self.check('TypeError', 'TypeError')
class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase):
@@ -49,6 +47,9 @@ class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase):
any_re = re.compile('.*')
any_re""", 're.RegexObject')
def test_from_import(self):
self.check('from os import path', 'os.path')
class TestFullNameWithCompletions(MixinTestFullName, TestCase):
operation = 'completions'