summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cmd2.py6
-rw-r--r--tests/test_utils.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 0615ed46..fecab628 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -630,7 +630,7 @@ now: True
def test_debug_not_settable(base_app):
# Set debug to False and make it unsettable
base_app.debug = False
- del base_app.settables['debug']
+ base_app.remove_settable('debug')
# Cause an exception
out, err = run_cmd(base_app, 'bad "quote')
@@ -638,6 +638,10 @@ def test_debug_not_settable(base_app):
# Since debug is unsettable, the user will not be given the option to enable a full traceback
assert err == ['Invalid syntax: No closing quotation']
+def test_remove_settable_keyerror(base_app):
+ with pytest.raises(KeyError):
+ base_app.remove_settable('fake')
+
def test_edit_file(base_app, request, monkeypatch):
# Set a fake editor just to make sure we have one. We aren't really going to call it due to the mock
base_app.editor = 'fooedit'
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 804e58be..5030ce0e 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -537,11 +537,13 @@ def test_str_to_bool_true():
assert cu.str_to_bool('true')
assert cu.str_to_bool('True')
assert cu.str_to_bool('TRUE')
+ assert cu.str_to_bool('tRuE')
def test_str_to_bool_false():
assert not cu.str_to_bool('false')
assert not cu.str_to_bool('False')
assert not cu.str_to_bool('FALSE')
+ assert not cu.str_to_bool('fAlSe')
def test_str_to_bool_invalid():
with pytest.raises(ValueError):