diff options
author | kotfu <kotfu@kotfu.net> | 2018-04-26 20:22:04 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-04-26 20:22:04 -0600 |
commit | 36e57da32b699c2af023a6bca8ccf2032fb7f8a5 (patch) | |
tree | 7d12567c1edac61edd2d736abbc345a127ec11ac /tests/test_completion.py | |
parent | 739d3f42715e59b61432cd7fbedacae4a4f80a16 (diff) | |
parent | 31352a6290a7ddbd1cb5c8ee6386377aebded66a (diff) | |
download | cmd2-git-36e57da32b699c2af023a6bca8ccf2032fb7f8a5.tar.gz |
Merge branch 'ply' of github.com:python-cmd2/cmd2 into ply
Diffstat (limited to 'tests/test_completion.py')
-rw-r--r-- | tests/test_completion.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index f916f2e8..46e68764 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -322,10 +322,11 @@ def test_path_completion_doesnt_match_wildcards(cmd2_app, request): # Currently path completion doesn't accept wildcards, so will always return empty results assert cmd2_app.path_complete(text, line, begidx, endidx) == [] -def test_path_completion_expand_user_dir(cmd2_app): - # Get the current user. We can't use getpass.getuser() since - # that doesn't work when running these tests on Windows in AppVeyor. - user = os.path.basename(os.path.expanduser('~')) +@pytest.mark.skipif(sys.platform == 'win32', reason="getpass.getuser() does not work on Windows in AppVeyor because " + "no user name environment variables are set") +def test_path_completion_complete_user(cmd2_app): + import getpass + user = getpass.getuser() text = '~{}'.format(user) line = 'shell fake {}'.format(text) @@ -336,7 +337,7 @@ def test_path_completion_expand_user_dir(cmd2_app): expected = text + os.path.sep assert expected in completions -def test_path_completion_user_expansion(cmd2_app): +def test_path_completion_user_path_expansion(cmd2_app): # Run path with a tilde and a slash if sys.platform.startswith('win'): cmd = 'dir' |