diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2009-03-30 21:54:41 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-03-30 21:54:41 (GMT) |
commit | eaaec27b6ed3e01675af083fa9c6c1687c1b3847 (patch) | |
tree | 4d0ab26d6b63e05b06f2517c67ec8de3c41ea832 /Lib/test/test_urllib.py | |
parent | 7f6b4f86e305ec63441657c57f5f546d15114ca0 (diff) | |
download | cpython-eaaec27b6ed3e01675af083fa9c6c1687c1b3847.zip cpython-eaaec27b6ed3e01675af083fa9c6c1687c1b3847.tar.gz cpython-eaaec27b6ed3e01675af083fa9c6c1687c1b3847.tar.bz2 |
Fix for Issue4962, issue4675.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 79e901f..c16f30d 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -830,6 +830,21 @@ class Pathname_Tests(unittest.TestCase): "url2pathname() failed; %s != %s" % (expect, result)) +class Utility_Tests(unittest.TestCase): + """Testcase to test the various utility functions in the urllib.""" + + def test_splitpasswd(self): + """Some of password examples are not sensible, but it is added to + confirming to RFC2617 and addressing issue4675. + """ + self.assertEqual(('user', 'ab'),urllib.parse.splitpasswd('user:ab')) + self.assertEqual(('user', 'a\nb'),urllib.parse.splitpasswd('user:a\nb')) + self.assertEqual(('user', 'a\tb'),urllib.parse.splitpasswd('user:a\tb')) + self.assertEqual(('user', 'a\rb'),urllib.parse.splitpasswd('user:a\rb')) + self.assertEqual(('user', 'a\fb'),urllib.parse.splitpasswd('user:a\fb')) + self.assertEqual(('user', 'a\vb'),urllib.parse.splitpasswd('user:a\vb')) + self.assertEqual(('user', 'a:b'),urllib.parse.splitpasswd('user:a:b')) + # Just commented them out. # Can't really tell why keep failing in windows and sparc. # Everywhere else they work ok, but on those machines, someteimes @@ -920,6 +935,7 @@ def test_main(): UnquotingTests, urlencode_Tests, Pathname_Tests, + Utility_Tests, #FTPWrapperTests, ) |