From 44921d18dea3be0327e8996cb9b3221451bd6eea Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Fri, 6 Dec 2019 11:37:42 +0100 Subject: [PATCH] [ADD][TST] test join args --- tests/test_command_list_split.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_command_list_split.py b/tests/test_command_list_split.py index 69c7c14..66bf26a 100644 --- a/tests/test_command_list_split.py +++ b/tests/test_command_list_split.py @@ -33,6 +33,15 @@ class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase): assert len(wexpect.split_command_line('\'one one\'')) == 1 assert len(wexpect.split_command_line(r'one\"one')) == 1 assert len(wexpect.split_command_line(r"This^' is a^'^ test")) == 3 + + def test_join_args(self): + cmd = 'foo bar "b a z"' + cmd2 = wexpect.join_args(wexpect.split_command_line(cmd)) + self.assertEqual(cmd2, cmd) + + cmd = ['foo', 'bar', 'b a z'] + cmd2 = wexpect.split_command_line(wexpect.join_args(cmd)) + self.assertEqual(cmd2, cmd) if __name__ == '__main__': unittest.main()