(self)
| 915 | 'alpha+beta+gamma') |
| 916 | |
| 917 | def test_quote_bytes(self): |
| 918 | # Bytes should quote directly to percent-encoded values |
| 919 | given = b"\xa2\xd8ab\xff" |
| 920 | expect = "%A2%D8ab%FF" |
| 921 | result = urllib.parse.quote(given) |
| 922 | self.assertEqual(expect, result, |
| 923 | "using quote(): %r != %r" % (expect, result)) |
| 924 | # Encoding argument should raise type error on bytes input |
| 925 | self.assertRaises(TypeError, urllib.parse.quote, given, |
| 926 | encoding="latin-1") |
| 927 | # quote_from_bytes should work the same |
| 928 | result = urllib.parse.quote_from_bytes(given) |
| 929 | self.assertEqual(expect, result, |
| 930 | "using quote_from_bytes(): %r != %r" |
| 931 | % (expect, result)) |
| 932 | |
| 933 | def test_quote_with_unicode(self): |
| 934 | # Characters in Latin-1 range, encoded by default in UTF-8 |
nothing calls this directly
no test coverage detected