summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-26 18:31:11 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-26 18:31:11 (GMT)
commitfaf4149f72575a826f65f7e0747254088195ef9b (patch)
tree1fdfc7d8f1f18776188e051e4a695866bc428ae2 /Lib/test
parent8ca69de23772af21a2e697ab7e73a72e29ef178d (diff)
downloadcpython-faf4149f72575a826f65f7e0747254088195ef9b.zip
cpython-faf4149f72575a826f65f7e0747254088195ef9b.tar.gz
cpython-faf4149f72575a826f65f7e0747254088195ef9b.tar.bz2
#6118: dont ignore encoding arguments for arguments with spaces in quote_plus().
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_urllib.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index da6bc2d..ba742af 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -510,6 +510,21 @@ class QuotingTests(unittest.TestCase):
self.assertEqual(expect, result,
"using quote(): %r != %r" % (expect, result))
+ def test_quote_plus_with_unicode(self):
+ # Encoding (latin-1) test for quote_plus
+ given = "\xa2\xd8 \xff"
+ expect = "%A2%D8+%FF"
+ result = urllib.parse.quote_plus(given, encoding="latin-1")
+ self.assertEqual(expect, result,
+ "using quote_plus(): %r != %r" % (expect, result))
+ # Errors test for quote_plus
+ given = "ab\u6f22\u5b57 cd"
+ expect = "ab%3F%3F+cd"
+ result = urllib.parse.quote_plus(given, encoding="latin-1",
+ errors="replace")
+ self.assertEqual(expect, result,
+ "using quote_plus(): %r != %r" % (expect, result))
+
class UnquotingTests(unittest.TestCase):
"""Tests for unquote() and unquote_plus()