diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-07-30 19:34:36 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-07-30 19:34:36 (GMT) |
commit | d496c4c9360b481ca68b68b6bba6b6687136e442 (patch) | |
tree | 5adc1762096fb8acf83605c87c5ea9ba9a9170c0 /Lib/test/test_urllib.py | |
parent | 0a9c3e91dc50ce22a48ff7364a6c297ffb91c19a (diff) | |
download | cpython-d496c4c9360b481ca68b68b6bba6b6687136e442.zip cpython-d496c4c9360b481ca68b68b6bba6b6687136e442.tar.gz cpython-d496c4c9360b481ca68b68b6bba6b6687136e442.tar.bz2 |
Fix issue9301 - handle unquote({}) kind of case.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 44574c9..23492fb 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -527,6 +527,7 @@ class QuotingTests(unittest.TestCase): self.assertEqual(expect, result, "using quote_plus(): %r != %r" % (expect, result)) + class UnquotingTests(unittest.TestCase): """Tests for unquote() and unquote_plus() @@ -555,6 +556,7 @@ class UnquotingTests(unittest.TestCase): "using unquote(): not all characters escaped: " "%s" % result) self.assertRaises(TypeError, urllib.parse.unquote, None) + self.assertRaises(TypeError, urllib.parse.unquote, ()) def test_unquoting_badpercent(self): # Test unquoting on bad percent-escapes @@ -589,8 +591,8 @@ class UnquotingTests(unittest.TestCase): result = urllib.parse.unquote_to_bytes(given) self.assertEqual(expect, result, "using unquote_to_bytes(): %r != %r" % (expect, result)) - self.assertRaises(TypeError, urllib.parse.unquote_to_bytes, None) + self.assertRaises(TypeError, urllib.parse.unquote_to_bytes, ()) def test_unquoting_mixed_case(self): # Test unquoting on mixed-case hex digits in the percent-escapes |