Show More
@@ -13,11 +13,11 b' from contextlib import contextmanager' | |||||
13 | import nose.tools as nt |
|
13 | import nose.tools as nt | |
14 |
|
14 | |||
15 | from traitlets.config.loader import Config |
|
15 | from traitlets.config.loader import Config | |
|
16 | from IPython import get_ipython | |||
16 | from IPython.core import completer |
|
17 | from IPython.core import completer | |
17 | from IPython.external.decorators import knownfailureif |
|
18 | from IPython.external.decorators import knownfailureif | |
18 | from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory |
|
19 | from IPython.utils.tempdir import TemporaryDirectory, TemporaryWorkingDirectory | |
19 | from IPython.utils.generics import complete_object |
|
20 | from IPython.utils.generics import complete_object | |
20 | from IPython.utils import py3compat |
|
|||
21 | from IPython.utils.py3compat import string_types, unicode_type |
|
21 | from IPython.utils.py3compat import string_types, unicode_type | |
22 | from IPython.testing import decorators as dec |
|
22 | from IPython.testing import decorators as dec | |
23 |
|
23 | |||
@@ -760,3 +760,21 b' def test_dict_key_completion_invalids():' | |||||
760 | _, matches = complete(line_buffer="empty['") |
|
760 | _, matches = complete(line_buffer="empty['") | |
761 | _, matches = complete(line_buffer="name_error['") |
|
761 | _, matches = complete(line_buffer="name_error['") | |
762 | _, matches = complete(line_buffer="d['\\") # incomplete escape |
|
762 | _, matches = complete(line_buffer="d['\\") # incomplete escape | |
|
763 | ||||
|
764 | def test_aimport_module_completer(): | |||
|
765 | ip = get_ipython() | |||
|
766 | _, matches = ip.complete('i', '%aimport i') | |||
|
767 | nt.assert_in('io', matches) | |||
|
768 | nt.assert_not_in('int', matches) | |||
|
769 | ||||
|
770 | def test_import_module_completer(): | |||
|
771 | ip = get_ipython() | |||
|
772 | _, matches = ip.complete('i', 'import i') | |||
|
773 | nt.assert_in('io', matches) | |||
|
774 | nt.assert_not_in('int', matches) | |||
|
775 | ||||
|
776 | def test_from_module_completer(): | |||
|
777 | ip = get_ipython() | |||
|
778 | _, matches = ip.complete('B', 'from io import B') | |||
|
779 | nt.assert_in('BytesIO', matches) | |||
|
780 | nt.assert_not_in('BaseException', matches) |
General Comments 0
You need to be logged in to leave comments.
Login now