diff options
author | kotfu <kotfu@kotfu.net> | 2018-05-06 01:12:14 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-05-06 01:12:14 -0600 |
commit | 529b783234f7721935c0e87a785c094784cb4fff (patch) | |
tree | 854140132519a2508962d9e99727682e902ec95b /tests | |
parent | 285b45bfa9ae79a936c35fd9c4b0ea0706082a3d (diff) | |
download | cmd2-git-529b783234f7721935c0e87a785c094784cb4fff.tar.gz |
Don’t allow wierd characters in alias names
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cmd2.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 33f5d86e..9dcfe692 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1705,6 +1705,17 @@ def test_unalias_non_existing(base_app, capsys): out, err = capsys.readouterr() assert "does not exist" in err +@pytest.mark.parametrize('alias_name', [ + '">"', + '"no>pe"' + '"no spaces"', + '"nopipe|"', + '"noterm;"', +]) +def test_create_invalid_alias(base_app, alias_name, capsys): + run_cmd(base_app, 'alias {} help'.format(alias_name)) + out, err = capsys.readouterr() + assert "can not contain" in err def test_ppaged(base_app): msg = 'testing...' |