Esempio n. 1
0
    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))
        self.assertEqual(windows.force_quote(original, **kwargs),
                         windows.wrap_quotes(inner_quoted))
Esempio n. 2
0
 def test_escaped_quote(self):
     self.assertEqual(windows.wrap_quotes(r'\"'), r'"\""')
     self.assertEqual(windows.wrap_quotes(r'\"foobar'), r'"\"foobar"')
     self.assertEqual(windows.wrap_quotes(r'foo\"bar'), r'"foo\"bar"')
     self.assertEqual(windows.wrap_quotes(r'foobar\"'), r'"foobar\""')
Esempio n. 3
0
 def test_simple(self):
     self.assertEqual(windows.wrap_quotes(''), '""')
     self.assertEqual(windows.wrap_quotes('f'), '"f"')
     self.assertEqual(windows.wrap_quotes('fo'), '"fo"')
     self.assertEqual(windows.wrap_quotes('foo'), '"foo"')