示例#1
0
    def test_prepare_string_argument_sh(self):
        expected_results = ('"normal_string"', '"string with spaces"',
                            '"string with quotes\\"a"',
                            '"string with s-quotes\'b"', '"bsn \n A"',
                            '"unrecognized \\q escape"')

        for string, result in zip(self.test_strings, expected_results):
            self.assertEqual(prepare_string_argument(string, "sh"), result)
示例#2
0
    def test_prepare_string_argument_sh(self):
        expected_results = ('"normal_string"',
                            '"string with spaces"',
                            '"string with quotes\\"a"',
                            '"string with s-quotes\'b"',
                            '"bsn \n A"',
                            '"unrecognized \\q escape"')

        for string, result in zip(self.test_strings, expected_results):
            self.assertEqual(prepare_string_argument(string, "sh"),
                             result)
示例#3
0
    def test_prepare_string_argument_linux_and_darwin(self):
        testoses = ("Linux", "Darwin")
        expected_results = ('"normal_string"', '"string with spaces"',
                            '"string with quotes\\"a"',
                            '"string with s-quotes\'b"', '"bsn \n A"',
                            '"unrecognized \\q escape"')

        for string, result in zip(self.test_strings, expected_results):
            for testos in testoses:
                self.assertEqual(prepare_string_argument(string, testos),
                                 result)
示例#4
0
    def test_prepare_string_argument_linux_and_darwin(self):
        testoses = ("Linux", "Darwin")
        expected_results = ('"normal_string"',
                            '"string with spaces"',
                            '"string with quotes\\"a"',
                            '"string with s-quotes\'b"',
                            '"bsn \n A"',
                            '"unrecognized \\q escape"')

        for string, result in zip(self.test_strings, expected_results):
            for testos in testoses:
                self.assertEqual(prepare_string_argument(string, testos),
                                 result)
示例#5
0
 def test_prepare_string_argument_unsupported(self):
     for string in self.test_strings:
         self.assertEqual(prepare_string_argument(string, "WeIrD_O/S"),
                          string)
示例#6
0
 def test_prepare_string_argument_unsupported(self):
     for string in self.test_strings:
         self.assertEqual(prepare_string_argument(string, "WeIrD_O/S"),
                          string)
示例#7
0
    def test_prepare_string_argument_unsupported_os(self):
        testos = "WeIrD_O/S"

        for string in self.test_strings:
            self.assertEqual(prepare_string_argument(string, testos), string)
示例#8
0
    def test_prepare_string_argument_unsupported_os(self):
        testos = "WeIrD_O/S"

        for string in self.test_strings:
            self.assertEqual(prepare_string_argument(string, testos), string)