summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-24 13:58:42 -0400
committerGitHub <noreply@github.com>2019-07-24 13:58:42 -0400
commitb823665299593fa2f12a5f1a86af11dbb6b7bc4b (patch)
treeb59fc95248a707e0c3ef69874cfccf24c9c5b392 /tests/test_utils.py
parent346589e7e81adcd2aff883776249778d57eb4faf (diff)
parent29eeef6829fc7fc4a7e706d90871e8c347de773a (diff)
downloadcmd2-git-b823665299593fa2f12a5f1a86af11dbb6b7bc4b.tar.gz
Merge pull request #739 from python-cmd2/presentation_stuff
Presentation stuff
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index edb6ca68..1890a753 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -93,13 +93,23 @@ 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 + '"'
your_str = '"foo" bar'
assert cu.quote_string_if_needed(your_str) == "'" + your_str + "'"
-def test_quot_string_if_needed_no():
+def test_quote_string_if_needed_no():
my_str = "HelloWorld"
assert cu.quote_string_if_needed(my_str) == my_str
your_str = "'Hello World'"