MCPcopy Create free account
hub / github.com/StackStorm/st2 / test_quote_unix

Method test_quote_unix

st2common/tests/unit/test_util_shell.py:25–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23
24class ShellUtilsTestCase(unittest.TestCase):
25 def test_quote_unix(self):
26 arguments = ["foo", "foo bar", "foo1 bar1", '"foo"', '"foo" "bar"', "'foo bar'"]
27 expected_values = [
28 """
29 foo
30 """,
31 """
32 'foo bar'
33 """,
34 """
35 'foo1 bar1'
36 """,
37 """
38 '"foo"'
39 """,
40 """
41 '"foo" "bar"'
42 """,
43 """
44 ''"'"'foo bar'"'"''
45 """,
46 ]
47
48 for argument, expected_value in zip(arguments, expected_values):
49 actual_value = quote_unix(value=argument)
50 expected_value = expected_value.lstrip()
51 self.assertEqual(actual_value, expected_value.strip())
52
53 def test_quote_windows(self):
54 arguments = ["foo", "foo bar", "foo1 bar1", '"foo"', '"foo" "bar"', "'foo bar'"]

Callers

nothing calls this directly

Calls 1

quote_unixFunction · 0.90

Tested by

no test coverage detected