summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-04 21:57:05 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-04 21:57:05 -0500
commit457123d3a1376a2ab713f0ff638313b0eacfcf3e (patch)
treeecffdeb48fdac5fe7a17c38c555ae932c9b89f64 /tests
parenta5d3f7959c252ee23cf6360b81292d376b8c6fcc (diff)
downloadcmd2-git-457123d3a1376a2ab713f0ff638313b0eacfcf3e.tar.gz
Updated CHANGELOG and made a few minor tweaks
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cmd2.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 8b14949c..671a6685 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -108,45 +108,6 @@ def test_base_show_long(base_app):
assert out == expected
-def test_cast():
- # Boolean
- assert utils.cast(True, True) == True
- assert utils.cast(True, False) == False
- assert utils.cast(True, 0) == False
- assert utils.cast(True, 1) == True
- assert utils.cast(True, 'on') == True
- assert utils.cast(True, 'off') == False
- assert utils.cast(True, 'ON') == True
- assert utils.cast(True, 'OFF') == False
- assert utils.cast(True, 'y') == True
- assert utils.cast(True, 'n') == False
- assert utils.cast(True, 't') == True
- assert utils.cast(True, 'f') == False
-
- # Non-boolean same type
- assert utils.cast(1, 5) == 5
- assert utils.cast(3.4, 2.7) == 2.7
- assert utils.cast('foo', 'bar') == 'bar'
- assert utils.cast([1,2], [3,4]) == [3,4]
-
-def test_cast_problems(capsys):
- expected = 'Problem setting parameter (now {}) to {}; incorrect type?\n'
-
- # Boolean current, with new value not convertible to bool
- current = True
- new = [True, True]
- assert utils.cast(current, new) == current
- out, err = capsys.readouterr()
- assert out == expected.format(current, new)
-
- # Non-boolean current, with new value not convertible to current type
- current = 1
- new = 'octopus'
- assert utils.cast(current, new) == current
- out, err = capsys.readouterr()
- assert out == expected.format(current, new)
-
-
def test_base_set(base_app):
out, err = run_cmd(base_app, 'set quiet True')
expected = normalize("""