diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-01 16:08:29 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-01 16:08:29 -0400 |
commit | 78f72044d8ad5fa194146d3f5df6763138bd0cba (patch) | |
tree | 9fd3280ad97271e1358a879825a259b206e17da2 | |
parent | 94cf4a12b112d5a3b4890bebde0a4dc40a815fcd (diff) | |
download | cmd2-git-78f72044d8ad5fa194146d3f5df6763138bd0cba.tar.gz |
Attempt at fixing failing Windows unit test
Windows doesn't have an "ls" command by default ...
-rw-r--r-- | tests/test_completion.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index e657f314..f81e55f9 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -235,14 +235,20 @@ def test_path_completion_doesnt_match_wildcards(cmd2_app, request): def test_path_completion_user_expansion(cmd2_app): # Run path with just a tilde text = '' - line = '!ls ~{}'.format(text) + if sys.platform.startswith('win'): + line = '!dir ~\{}'.format(text) + else: + line = '!ls ~{}'.format(text) endidx = len(line) begidx = endidx - len(text) completions_tilde = cmd2_app.path_complete(text, line, begidx, endidx) # Run path complete on the user's home directory user_dir = os.path.expanduser('~') - line = '!ls {}'.format(user_dir) + if sys.platform.startswith('win'): + line = '!dir {}'.format(user_dir) + else: + line = '!ls {}'.format(user_dir) endidx = len(line) begidx = endidx - len(text) completions_home = cmd2_app.path_complete(text, line, begidx, endidx) |