Show More
@@ -14,8 +14,6 b' import tempfile' | |||
|
14 | 14 | import unittest |
|
15 | 15 | from os.path import join |
|
16 | 16 | |
|
17 | import nose.tools as nt | |
|
18 | ||
|
19 | 17 | from IPython.core.completerlib import magic_run_completer, module_completion, try_import |
|
20 | 18 | from IPython.utils.tempdir import TemporaryDirectory |
|
21 | 19 | from IPython.testing.decorators import onlyif_unicode_paths |
@@ -140,7 +138,7 b' def test_import_invalid_module():' | |||
|
140 | 138 | |
|
141 | 139 | s = set( module_completion('import foo') ) |
|
142 | 140 | intersection = s.intersection(invalid_module_names) |
|
143 |
|
|
|
141 | assert intersection == set() | |
|
144 | 142 | |
|
145 | 143 | assert valid_module_names.issubset(s), valid_module_names.intersection(s) |
|
146 | 144 | |
@@ -153,15 +151,15 b' def test_bad_module_all():' | |||
|
153 | 151 | testsdir = os.path.dirname(__file__) |
|
154 | 152 | sys.path.insert(0, testsdir) |
|
155 | 153 | try: |
|
156 |
results = module_completion( |
|
|
157 |
|
|
|
154 | results = module_completion("from bad_all import ") | |
|
155 | assert "puppies" in results | |
|
158 | 156 | for r in results: |
|
159 |
|
|
|
157 | assert isinstance(r, str) | |
|
160 | 158 | |
|
161 | 159 | # bad_all doesn't contain submodules, but this completion |
|
162 | 160 | # should finish without raising an exception: |
|
163 | 161 | results = module_completion("import bad_all.") |
|
164 |
|
|
|
162 | assert results == [] | |
|
165 | 163 | finally: |
|
166 | 164 | sys.path.remove(testsdir) |
|
167 | 165 | |
@@ -189,6 +187,6 b' def test_valid_exported_submodules():' | |||
|
189 | 187 | """ |
|
190 | 188 | results = module_completion("import os.pa") |
|
191 | 189 | # ensure we get a valid submodule: |
|
192 |
|
|
|
190 | assert "os.path" in results | |
|
193 | 191 | # ensure we don't get objects that aren't submodules: |
|
194 |
|
|
|
192 | assert "os.pathconf" not in results |
General Comments 0
You need to be logged in to leave comments.
Login now