Skip to content

Commit b472d2b

Browse files
committed
Fixing more unit tests
1 parent e09a460 commit b472d2b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/test_completion.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,14 @@ def test_path_completion_user_expansion():
403403

404404
line = 'shell {} ~{}'.format(cmd, os.path.sep)
405405
endidx = len(line)
406-
begidx = endidx - len(text)
406+
begidx = endidx
407407
completions_tilde_slash = path_complete(text, line, begidx, endidx)
408408

409409
# Run path complete on the user's home directory
410-
user_dir = os.path.expanduser('~')
411-
if sys.platform.startswith('win'):
412-
line = 'shell dir {}'.format(user_dir)
413-
else:
414-
line = 'shell ls {}'.format(user_dir)
410+
user_dir = os.path.expanduser('~') + os.path.sep
411+
line = 'shell {} {}'.format(cmd, user_dir)
415412
endidx = len(line)
416-
begidx = endidx - len(text)
413+
begidx = endidx
417414
completions_home = path_complete(text, line, begidx, endidx)
418415

419416
# Verify that the results are the same in both cases

0 commit comments

Comments
 (0)