summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkmvanbrunt <kmvanbrunt@gmail.com>2018-04-26 13:09:46 -0400
committerGitHub <noreply@github.com>2018-04-26 13:09:46 -0400
commita93437308bc597ff2fa759db144fd97d4db31c98 (patch)
tree37eeb6dbcefa40743debc77e1b0c6312d9aac753
parentf11b06374aaf56b755de33a763220140d36eab64 (diff)
parent127a3b3e0b1ef0cc42f43970f666a2193360d57b (diff)
downloadcmd2-git-a93437308bc597ff2fa759db144fd97d4db31c98.tar.gz
Merge pull request #372 from python-cmd2/unit_test
No longer running test_path_completion_complete_user unit test on Win…
-rw-r--r--tests/test_completion.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py
index cf45f281..ef35b635 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'