Skip to content

Commit ec175f8

Browse files
committed
Added a unit test which exercises multiple aliases after first creating multiple aliases
1 parent 40fa455 commit ec175f8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_cmd2.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,20 @@ def test_complete_unalias(base_app):
18311831
result = base_app.complete_unalias(text, line, begidx, endidx)
18321832
assert sorted(expected) == sorted(result)
18331833

1834+
def test_multiple_aliases(base_app):
1835+
alias1 = 'h1'
1836+
alias2 = 'h2'
1837+
run_cmd(base_app, 'alias {} help'.format(alias1))
1838+
run_cmd(base_app, 'alias {} help -v'.format(alias2))
1839+
out = run_cmd(base_app, alias1)
1840+
expected = normalize(BASE_HELP)
1841+
assert out == expected
1842+
1843+
out = run_cmd(base_app, alias2)
1844+
expected = normalize(BASE_HELP_VERBOSE)
1845+
assert out == expected
1846+
1847+
18341848
def test_ppaged(base_app):
18351849
msg = 'testing...'
18361850
end = '\n'

0 commit comments

Comments
 (0)