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

Method test_abspath_file_completions

tests/test_completer.py:395–412  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

393 sys.platform == "win32", reason="abspath completions fail on Windows"
394 )
395 def test_abspath_file_completions(self):
396 ip = get_ipython()
397 with TemporaryDirectory() as tmpdir:
398 prefix = os.path.join(tmpdir, "foo")
399 suffixes = ["1", "2"]
400 names = [prefix + s for s in suffixes]
401 for n in names:
402 open(n, "w", encoding="utf-8").close()
403
404 # Check simple completion
405 c = ip.complete(prefix)[1]
406 self.assertEqual(c, names)
407
408 # Now check with a function call
409 cmd = 'a = f("%s' % prefix
410 c = ip.complete(prefix, cmd)[1]
411 comp = [prefix + s for s in suffixes]
412 self.assertEqual(c, comp)
413
414 def test_local_file_completions(self):
415 ip = get_ipython()

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
closeMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected