Revert 1.170. Add tests.

This commit is contained in:
Raymond Hettinger 2005-09-10 14:30:09 +00:00
parent 803ce801ab
commit 2bdec7bfb0
2 changed files with 12 additions and 3 deletions

View file

@ -353,6 +353,12 @@ class QuotingTests(unittest.TestCase):
self.assertEqual(expect, result,
"using quote_plus(): %s != %s" % (expect, result))
def test_quoting_plus(self):
self.assertEqual(urllib.quote_plus('alpha+beta gamma'),
'alpha%2Bbeta+gamma')
self.assertEqual(urllib.quote_plus('alpha+beta gamma', '+'),
'alpha+beta+gamma')
class UnquotingTests(unittest.TestCase):
"""Tests for unquote() and unquote_plus()