diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/conftest.py | 8 | ||||
-rw-r--r-- | tests/test_autocompletion.py | 6 | ||||
-rw-r--r-- | tests/test_cmd2.py | 8 |
3 files changed, 10 insertions, 12 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 3f3b862e..f86a4c63 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -42,14 +42,14 @@ load Runs commands in script file that is encoded as either ASCII py Invoke python command, shell, or script pyscript Runs a python script file inside the console quit Exits this application. -set Sets a settable parameter or shows current settings of parameters. +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. unalias Unsets aliases """ # Help text for the history command -HELP_HISTORY = """usage: history [-h] [-r | -e | -s | -o FILE | -t TRANSCRIPT | -c] [arg] +HELP_HISTORY = """Usage: history [arg] [-h] [-r | -e | -s | -o FILE | -t TRANSCRIPT | -c] View, run, edit, save, or clear previously entered commands. @@ -65,9 +65,9 @@ optional arguments: -r, --run run selected history items -e, --edit edit and then run selected history items -s, --script script format; no separation lines - -o FILE, --output-file FILE + -o, --output-file FILE output commands to a script file - -t TRANSCRIPT, --transcript TRANSCRIPT + -t, --transcript TRANSCRIPT output commands and results to a transcript file -c, --clear clears all history """ diff --git a/tests/test_autocompletion.py b/tests/test_autocompletion.py index e0a71831..8aa26e0e 100644 --- a/tests/test_autocompletion.py +++ b/tests/test_autocompletion.py @@ -19,8 +19,8 @@ def cmd2_app(): SUGGEST_HELP = '''Usage: suggest -t {movie, show} [-h] [-d DURATION{1..2}] -Suggest command demonstrates argparse customizations See hybrid_suggest and -orig_suggest to compare the help output. +Suggest command demonstrates argparse customizations. +See hybrid_suggest and orig_suggest to compare the help output. required arguments: -t, --type {movie, show} @@ -59,7 +59,7 @@ def test_help_required_group(cmd2_app, capsys): assert out1 == out2 assert out1[0].startswith('Usage: suggest') assert out1[1] == '' - assert out1[2].startswith('Suggest command demonstrates argparse customizations ') + assert out1[2].startswith('Suggest command demonstrates argparse customizations.') assert out1 == normalize(SUGGEST_HELP) diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index b6081f53..b75cd102 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -62,7 +62,7 @@ def test_base_argparse_help(base_app, capsys): out2 = run_cmd(base_app, 'help set') assert out1 == out2 - assert out1[0].startswith('usage: set') + assert out1[0].startswith('Usage: set') assert out1[1] == '' assert out1[2].startswith('Sets a settable parameter') @@ -71,10 +71,8 @@ def test_base_invalid_option(base_app, capsys): out, err = capsys.readouterr() out = normalize(out) err = normalize(err) - assert len(err) == 3 - assert len(out) == 15 assert 'Error: unrecognized arguments: -z' in err[0] - assert out[0] == 'usage: set [-h] [-a] [-l] [settable [settable ...]]' + assert out[0] == 'Usage: set settable{0..2} [-h] [-a] [-l]' def test_base_shortcuts(base_app): out = run_cmd(base_app, 'shortcuts') @@ -1252,7 +1250,7 @@ load Runs commands in script file that is encoded as either ASCII py Invoke python command, shell, or script pyscript Runs a python script file inside the console quit Exits this application. -set Sets a settable parameter or shows current settings of parameters. +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. unalias Unsets aliases |