Merge pull request #74 from tkf/full_name-builtin

No __builtin__ prefix for BaseOutput.full_name
This commit is contained in:
David Halter
2012-12-02 12:53:57 -08:00
2 changed files with 7 additions and 2 deletions

View File

@@ -16,7 +16,9 @@ class BaseOutput(object):
'os2emxpath': 'os.path',
'macpath': 'os.path',
'genericpath': 'os.path',
'_io': 'io'
'_io': 'io',
'__builtin__': '',
'builtins': '',
}
_tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in {
@@ -101,7 +103,7 @@ class BaseOutput(object):
if tuple(path[:len(key)]) == key:
path = [repl] + path[len(key):]
return '.'.join(path)
return '.'.join(path if path[0] else path[1:])
def __repr__(self):
return "<%s %s>" % (type(self).__name__, self.description)

View File

@@ -234,6 +234,9 @@ class TestFeature(Base):
assert self.complete('import os; os.path.join')[0].full_name \
== 'os.path.join'
def test_full_name_builtin(self):
self.assertEqual(self.complete('type')[0].full_name, 'type')
def test_full_name_tuple_mapping(self):
s = """
import re