summaryrefslogtreecommitdiff
path: root/tests/test_history.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-03-31 14:53:50 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-03-31 15:34:37 -0400
commit06f05261945d706b668c8021a7ae6f8dcd15b9ea (patch)
tree26839ea0e5e4527a795336e6bdbec3a3fa4730b7 /tests/test_history.py
parent5165edec890575682f345fc42f5a53e10ed575b9 (diff)
downloadcmd2-git-error_cleanup.tar.gz
Replaced some pexcept() calls with perror().error_cleanup
Converted some strings to f-strings. Fixed some grammar in error messages and docs. Increased code coverage.
Diffstat (limited to 'tests/test_history.py')
-rwxr-xr-xtests/test_history.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_history.py b/tests/test_history.py
index 41ae2a9e..d1285705 100755
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -616,7 +616,7 @@ def test_history_verbose_with_other_options(base_app):
for opt in options_to_test:
out, err = run_cmd(base_app, 'history -v ' + opt)
assert len(out) == 4
- assert out[0] == '-v can not be used with any other options'
+ assert out[0] == '-v cannot be used with any other options'
assert out[1].startswith('Usage:')
@@ -635,7 +635,7 @@ def test_history_script_with_invalid_options(base_app):
for opt in options_to_test:
out, err = run_cmd(base_app, 'history -s ' + opt)
assert len(out) == 4
- assert out[0] == '-s and -x can not be used with -c, -r, -e, -o, or -t'
+ assert out[0] == '-s and -x cannot be used with -c, -r, -e, -o, or -t'
assert out[1].startswith('Usage:')
@@ -653,7 +653,7 @@ def test_history_expanded_with_invalid_options(base_app):
for opt in options_to_test:
out, err = run_cmd(base_app, 'history -x ' + opt)
assert len(out) == 4
- assert out[0] == '-s and -x can not be used with -c, -r, -e, -o, or -t'
+ assert out[0] == '-s and -x cannot be used with -c, -r, -e, -o, or -t'
assert out[1].startswith('Usage:')
@@ -761,7 +761,7 @@ def test_history_file_permission_error(mocker, capsys):
cmd2.Cmd(persistent_history_file='/tmp/doesntmatter')
out, err = capsys.readouterr()
assert not out
- assert 'Can not read' in err
+ assert 'Cannot read' in err
def test_history_file_conversion_no_truncate_on_init(hist_file, capsys):
@@ -843,4 +843,4 @@ def test_persist_history_permission_error(hist_file, mocker, capsys):
app._persist_history()
out, err = capsys.readouterr()
assert not out
- assert 'Can not write' in err
+ assert 'Cannot write' in err