Add failing test for completing arguments after '%run foo.py '
Thomas Kluyver -
r14814:05e03435
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -31,9 +31,11 class MockEvent(object):
31 # Test functions begin
31 # Test functions begin
32 #-----------------------------------------------------------------------------
32 #-----------------------------------------------------------------------------
33 class Test_magic_run_completer(unittest.TestCase):
33 class Test_magic_run_completer(unittest.TestCase):
34 files = [u"aao.py", u"a.py", u"b.py", u"aao.txt"]
35
34 def setUp(self):
36 def setUp(self):
35 self.BASETESTDIR = tempfile.mkdtemp()
37 self.BASETESTDIR = tempfile.mkdtemp()
36 for fil in [u"aao.py", u"a.py", u"b.py", u"aao.txt"]:
38 for fil in self.files:
37 with open(join(self.BASETESTDIR, fil), "w") as sfile:
39 with open(join(self.BASETESTDIR, fil), "w") as sfile:
38 sfile.write("pass\n")
40 sfile.write("pass\n")
39 self.oldpath = py3compat.getcwd()
41 self.oldpath = py3compat.getcwd()
@@ -66,6 +68,11 class Test_magic_run_completer(unittest.TestCase):
66 match = set(magic_run_completer(mockself, event))
68 match = set(magic_run_completer(mockself, event))
67 self.assertEqual(match, set([u"a.py", u"aao.py"]))
69 self.assertEqual(match, set([u"a.py", u"aao.py"]))
68
70
71 def test_completion_more_args(self):
72 event = MockEvent(u'%run a.py ')
73 match = set(magic_run_completer(None, event))
74 self.assertEqual(match, set(self.files))
75
69 def test_completion_in_dir(self):
76 def test_completion_in_dir(self):
70 # Github issue #3459
77 # Github issue #3459
71 event = MockEvent(u'%run a.py {}'.format(join(self.BASETESTDIR, 'a')))
78 event = MockEvent(u'%run a.py {}'.format(join(self.BASETESTDIR, 'a')))
Comments 0
You need to be logged in to leave comments. Login now