(self)
| 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() |
nothing calls this directly
no test coverage detected