##// END OF EJS Templates
More work to address review comments....
More work to address review comments. * Moved twisted import to top-level of :mod:`IPython.kernel.error` (r1333). * Added docstring about :meth:`InteractiveShell.load_extension` returning whatever the return value of :func:`load_ipython_extension` is. * Renamed the :attr:`user_config_ns` attribute to :attr:`user_ns_hidden` to better reflect what it does. * Moved the ``%HOME`` to the end of home directory options attemped in :func:`IPython.utils.path.get_home_dir` on Windows.

File last commit:

r938:e55d2f29
r2509:70d27296
Show More
test_completer.py
36 lines | 773 B | text/x-python | PythonLexer
"""
comp
"""
# The prefilter always ends in a call to some self.handle_X method. We swap
# all of those out so that we can capture which one was called.
import sys
sys.path.append('..')
import IPython
import IPython.ipapi
IPython.Shell.start()
ip = IPython.ipapi.get()
completer = ip.IP.Completer
print completer
def do_test(text, line):
def get_endix():
idx = len(line)
print "Call endidx =>",idx
return idx
def get_line_buffer():
print "Lbuf =>",line
return line
completer.get_line_buffer = get_line_buffer
completer.get_endidx = get_endix
l = completer.all_completions(text)
return l
l = do_test ('p', 'print p')
assert 'pow' in l
l = do_test ('p', 'import p')
assert 'pprint' in l