diff options
author | Eric Lin <anselor@gmail.com> | 2018-04-27 22:57:47 -0400 |
---|---|---|
committer | Eric Lin <anselor@gmail.com> | 2018-04-27 22:57:47 -0400 |
commit | 452c396c1b3b417a1e085d5b4ab192bbc13d34b8 (patch) | |
tree | c1dce51fc4253a664c474bcff6e9b3801f1cf977 /tests | |
parent | ae86103f6b8acf7765804382237564356f095b74 (diff) | |
parent | 1306eebade58d7ffe5d0ab4008006b7fb3501b54 (diff) | |
download | cmd2-git-452c396c1b3b417a1e085d5b4ab192bbc13d34b8.tar.gz |
Merge remote-tracking branch 'origin/master' into bash_completion
Updated argcomplete_bridge to use new constants/utils.
Diffstat (limited to 'tests')
-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 2c600018..7026db48 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' |