Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed May 7, 2022
1 parent 2a0435a commit 01e23e7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/unit/plugins/module_utils/test_quoting.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(r'"\\"', {}, ('\\', 4)),
(r'"\?"', {}, ('?', 4)),
(r'"\$"', {}, ('$', 4)),
(r'"\_"', {}, ('_', 4)),
(r'"\_"', {}, (' ', 4)),
(r'"\a"', {}, ('\a', 4)),
(r'"\b"', {}, ('\b', 4)),
(r'"\f"', {}, (to_native(b'\xff'), 4)),
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_convert_list_to_dictionary_errors(list, kwargs, message):


TEST_JOIN_ROUTEROS_COMMAND = [
(['a=b', 'c=d=e', 'e=', 'f', 'g=h i j', 'h="h"'], r'a=b c="d=e" e="" f g="h i j" h="\"h\""'),
(['a=b', 'c=d=e', 'e=', 'f', 'g=h i j', 'h="h"'], r'a=b c="d=e" e="" f g="h\_i\_j" h="\"h\""'),
]


Expand All @@ -180,8 +180,8 @@ def test_join_routeros_command(list, expected):
(r'', r''),
(r'a', r'a'),
(r'a=b', r'a=b'),
(r'a=b c', r'a="b c"'),
(r'a="b c"', r'a="\"b c\""'),
(r'a=b c', r'a="b\_c"'),
(r'a="b c"', r'a="\"b\_c\""'),
(r"a='b", "a=\"'b\""),
(r"a=b'", "a=\"b'\""),
(r'a=""', r'a="\"\""'),
Expand Down Expand Up @@ -212,19 +212,20 @@ def test_quote_routeros_argument_errors(argument, message):
TEST_QUOTE_ROUTEROS_ARGUMENT_VALUE = [
(r'', r'""'),
(r";", r'";"'),
(r" ", r'" "'),
(r" ", r'"\_"'),
(r"=", r'"="'),
(r'a', r'a'),
(r'a=b', r'"a=b"'),
(r'b c', r'"b c"'),
(r'"b c"', r'"\"b c\""'),
(r'b c', r'"b\_c"'),
(r'"b c"', r'"\"b\_c\""'),
("'b", "\"'b\""),
("b'", "\"b'\""),
('"', r'"\""'),
('\\', r'"\\"'),
('?', r'"\?"'),
('$', r'"\$"'),
('_', r'_'),
(' ', r'"\_"'),
('\a', r'"\a"'),
('\b', r'"\b"'),
# (to_native(b'\xff'), r'"\f"'),
Expand Down

0 comments on commit 01e23e7

Please sign in to comment.