diff options
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r-- | tests/test_utils.py | 12 |
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'" |