summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py10
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 + '"'