diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-12 22:49:34 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-12 22:49:34 -0400 |
commit | 2d82b8f49d212b06c33ed06fb9db5465aa7a8b95 (patch) | |
tree | 8fe9f3032142efb84da82e8a0285fd38b26fbdfe /tests/test_cmd2.py | |
parent | 52d76c18246e70a5311b94c452c236524d64586e (diff) | |
parent | 49236d98a770d9604e65eb1728d2f8d68e35d493 (diff) | |
download | cmd2-git-2d82b8f49d212b06c33ed06fb9db5465aa7a8b95.tar.gz |
Merged master into colorize branch
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 6fb64b86..e2a3d854 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1235,15 +1235,15 @@ diddly This command does diddly Other ================================================================================ alias Define or display aliases -help List available commands with "help" or detailed help with "help cmd". -history View, run, edit, save, or clear previously entered commands. -load Runs commands in script file that is encoded as either ASCII or UTF-8 text. +help List available commands with "help" or detailed help with "help cmd" +history View, run, edit, save, or clear previously entered commands +load Runs commands in script file that is encoded as either ASCII or UTF-8 text py Invoke python command, shell, or script pyscript Runs a python script file inside the console -quit Exits this application. +quit Exits this application set Sets a settable parameter or shows current settings of parameters -shell Execute a command as if at the OS prompt. -shortcuts Lists shortcuts (aliases) available. +shell Execute a command as if at the OS prompt +shortcuts Lists shortcuts available unalias Unsets aliases Undocumented commands: @@ -1750,6 +1750,15 @@ def test_alias(base_app, capsys): out = run_cmd(base_app, 'alias fake') assert out == normalize('alias fake pyscript') +def test_alias_with_quotes(base_app, capsys): + # Create the alias + out = run_cmd(base_app, 'alias fake help ">" "out file.txt"') + assert out == normalize("Alias 'fake' created") + + # Lookup the new alias (Only the redirector should be unquoted) + out = run_cmd(base_app, 'alias fake') + assert out == normalize('alias fake help > "out file.txt"') + def test_alias_lookup_invalid_alias(base_app, capsys): # Lookup invalid alias out = run_cmd(base_app, 'alias invalid') |