##// END OF EJS Templates
Ross Jones -
Show More
@@ -18,8 +18,9 b' from os.path import join'
18 18 import nose.tools as nt
19 19 from nose import SkipTest
20 20
21 from IPython.core.completerlib import magic_run_completer
21 from IPython.core.completerlib import magic_run_completer, module_completion
22 22 from IPython.utils import py3compat
23 from IPython.utils.tempdir import TemporaryDirectory
23 24
24 25
25 26 class MockEvent(object):
@@ -65,3 +66,14 b' class Test_magic_run_completer(unittest.TestCase):'
65 66 match = set(magic_run_completer(mockself, event))
66 67 self.assertEqual(match, set([u"a.py", u"aaø.py"]))
67 68
69 def test_import_invalid_module(self):
70 """Testing of issue https://github.com/ipython/ipython/issues/1107"""
71 invalid_module_names = set(['foo-bar', 'foo:bar', '10foo'])
72 with TemporaryDirectory() as tmpdir:
73 sys.path.insert( 0, tmpdir )
74 for name in invalid_module_names:
75 filename = os.path.join(tmpdir, name + '.py')
76 open(filename, 'w').close()
77
78 s = set( module_completion('import foo') )
79 self.assertFalse( s.intersection(invalid_module_names) )
General Comments 0
You need to be logged in to leave comments. Login now