summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-25 15:10:38 -0400
committerGitHub <noreply@github.com>2018-09-25 15:10:38 -0400
commitdac03119e5932f8a34a1318122e2f45fa875084c (patch)
tree4cf20c703452c3324fee22bc6124a3cc69ee4674 /tests/test_cmd2.py
parent38f070a5876e91945bfadd3fe60ddcb8b21b96c3 (diff)
parentec175f8269e2cbaa4b3ab01baa58f41cc9e8c136 (diff)
downloadcmd2-git-dac03119e5932f8a34a1318122e2f45fa875084c.tar.gz
Merge pull request #542 from python-cmd2/alias_fix
Fixed issue where only first alias was working
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 17c19f2a..e3992c7b 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1828,7 +1828,22 @@ def test_complete_unalias(base_app):
# Validate that there are now completions
expected = ['fake', 'fall']
- assert base_app.complete_unalias(text, line, begidx, endidx) == expected
+ result = base_app.complete_unalias(text, line, begidx, endidx)
+ assert sorted(expected) == sorted(result)
+
+def test_multiple_aliases(base_app):
+ alias1 = 'h1'
+ alias2 = 'h2'
+ run_cmd(base_app, 'alias {} help'.format(alias1))
+ run_cmd(base_app, 'alias {} help -v'.format(alias2))
+ out = run_cmd(base_app, alias1)
+ expected = normalize(BASE_HELP)
+ assert out == expected
+
+ out = run_cmd(base_app, alias2)
+ expected = normalize(BASE_HELP_VERBOSE)
+ assert out == expected
+
def test_ppaged(base_app):
msg = 'testing...'