Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05e0343

Browse files
committed
Add failing test for completing arguments after '%run foo.py '
1 parent faf01ee commit 05e0343

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

IPython/core/tests/test_completerlib.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ def __init__(self, line):
3131
# Test functions begin
3232
#-----------------------------------------------------------------------------
3333
class Test_magic_run_completer(unittest.TestCase):
34+
files = [u"aao.py", u"a.py", u"b.py", u"aao.txt"]
35+
3436
def setUp(self):
3537
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:
3739
with open(join(self.BASETESTDIR, fil), "w") as sfile:
3840
sfile.write("pass\n")
3941
self.oldpath = py3compat.getcwd()
@@ -66,6 +68,11 @@ def test_3(self):
6668
match = set(magic_run_completer(mockself, event))
6769
self.assertEqual(match, set([u"a.py", u"aao.py"]))
6870

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+
6976
def test_completion_in_dir(self):
7077
# Github issue #3459
7178
event = MockEvent(u'%run a.py {}'.format(join(self.BASETESTDIR, 'a')))

0 commit comments

Comments
 (0)