diff options
author | kotfu <kotfu@kotfu.net> | 2018-05-23 20:59:26 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-05-23 20:59:26 -0600 |
commit | 1a70b90f375997751bc7df16b5e3f58c6194c71b (patch) | |
tree | 1abe43d088060e24bb889e3db19fc5a1a4a82562 /tests/test_cmd2.py | |
parent | b1516f4b09518bb6d33abfeb14e1459ed03f34d8 (diff) | |
parent | 5d64ebee348aeffb02fc385f903c9af431e3721b (diff) | |
download | cmd2-git-1a70b90f375997751bc7df16b5e3f58c6194c71b.tar.gz |
Merge branch 'master' into speedup_import
# Conflicts:
# cmd2/cmd2.py
# tests/test_completion.py
# tests/test_submenu.py
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 11c2cad8..c66b1264 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1427,7 +1427,7 @@ def test_clipboard_failure(capsys): # Make sure we got the error output out, err = capsys.readouterr() assert out == '' - assert 'Cannot redirect to paste buffer; install ``xclip`` and re-run to enable' in err + assert "Cannot redirect to paste buffer; install 'pyperclip' and re-run to enable" in err class CmdResultApp(cmd2.Cmd): @@ -1685,12 +1685,6 @@ def test_alias_lookup_invalid_alias(base_app, capsys): out, err = capsys.readouterr() assert "not found" in err -def test_alias_with_invalid_name(base_app, capsys): - run_cmd(base_app, 'alias @ help') - out, err = capsys.readouterr() - assert "can only contain the following characters" in err - - def test_unalias(base_app): # Create an alias run_cmd(base_app, 'alias fake pyscript') @@ -1708,6 +1702,18 @@ 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;"', + 'noembedded"quotes', +]) +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...' |