MCPcopy Index your code
hub / github.com/ipython/ipython / test_completion_in_dir

Method test_completion_in_dir

tests/test_completerlib.py:74–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

72 self.assertEqual(match, set(self.files + self.dirs))
73
74 def test_completion_in_dir(self):
75 # Github issue #3459
76 event = MockEvent("%run a.py {}".format(join(self.BASETESTDIR, "a")))
77 print(repr(event.line))
78 match = set(magic_run_completer(None, event))
79 # We specifically use replace here rather than normpath, because
80 # at one point there were duplicates 'adir' and 'adir/', and normpath
81 # would hide the failure for that.
82 self.assertEqual(
83 match,
84 {
85 join(self.BASETESTDIR, f).replace("\\", "/")
86 for f in ("a.py", "aao.py", "aao.txt", "adir/")
87 },
88 )
89
90
91class Test_magic_run_completer_nonascii(unittest.TestCase):

Callers

nothing calls this directly

Calls 4

magic_run_completerFunction · 0.90
MockEventClass · 0.85
replaceMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected