diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-24 12:09:24 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-24 12:09:24 -0400 |
commit | 35e084f64f715f90e2bfba232a299301b9c5d850 (patch) | |
tree | 68d40fccd78b2aa63d4aed60ef124ba43a90b45d /tests/test_utils.py | |
parent | f3325cb39e9e20aa24d07107ebf048029059b44f (diff) | |
download | cmd2-git-35e084f64f715f90e2bfba232a299301b9c5d850.tar.gz |
Added unit tests
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py index c32d6870..1890a753 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -93,6 +93,16 @@ def test_is_quoted_no(): simple_str = "hello world" assert not cu.is_quoted(simple_str) +def test_quote_string(): + my_str = "Hello World" + assert cu.quote_string(my_str) == '"' + my_str + '"' + + my_str = "'Hello World'" + assert cu.quote_string(my_str) == '"' + my_str + '"' + + my_str = '"Hello World"' + assert cu.quote_string(my_str) == "'" + my_str + "'" + def test_quote_string_if_needed_yes(): my_str = "Hello World" assert cu.quote_string_if_needed(my_str) == '"' + my_str + '"' |