def test_literal(self): self.assertQuote(shell_literal('>'), False, '>', '>') self.assertQuote(shell_literal(''), False, '', '') s = shell_literal('>') + 'foo bar' self.assertEqual(windows.quote(s), '>"foo bar"') self.assertEqual(windows.quote_info(s), ('>"foo bar"', True))
def assertQuote(self, original, needs_quote, inner_quoted, quoted, **kwargs): self.assertEqual(windows.inner_quote(original, **kwargs), inner_quoted) self.assertEqual(windows.inner_quote_info(original, **kwargs), (inner_quoted, needs_quote)) self.assertEqual(windows.quote(original, **kwargs), quoted) self.assertEqual(windows.quote_info(original, **kwargs), (quoted, needs_quote))