Show More
@@ -157,6 +157,11 b' def test_bad_module_all():' | |||||
157 | nt.assert_in('puppies', results) |
|
157 | nt.assert_in('puppies', results) | |
158 | for r in results: |
|
158 | for r in results: | |
159 | nt.assert_is_instance(r, str) |
|
159 | nt.assert_is_instance(r, str) | |
|
160 | ||||
|
161 | # bad_all doesn't contain submodules, but this completion | |||
|
162 | # should finish without raising an exception: | |||
|
163 | results = module_completion("import bad_all.") | |||
|
164 | nt.assert_equal(results, []) | |||
160 | finally: |
|
165 | finally: | |
161 | sys.path.remove(testsdir) |
|
166 | sys.path.remove(testsdir) | |
162 |
|
167 | |||
@@ -176,3 +181,14 b' def test_module_without_init():' | |||||
176 | assert s == [] |
|
181 | assert s == [] | |
177 | finally: |
|
182 | finally: | |
178 | sys.path.remove(tmpdir) |
|
183 | sys.path.remove(tmpdir) | |
|
184 | ||||
|
185 | ||||
|
186 | def test_valid_exported_submodules(): | |||
|
187 | """ | |||
|
188 | Test checking exported (__all__) objects are submodules | |||
|
189 | """ | |||
|
190 | results = module_completion("import os.pa") | |||
|
191 | # ensure we get a valid submodule: | |||
|
192 | nt.assert_in("os.path", results) | |||
|
193 | # ensure we don't get objects that aren't submodules: | |||
|
194 | nt.assert_not_in("os.pathconf", results) |
General Comments 0
You need to be logged in to leave comments.
Login now