Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)