diff options
| author | Senthil Kumaran <orsenthil@gmail.com> | 2009-04-21 03:24:19 (GMT) |
|---|---|---|
| committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-04-21 03:24:19 (GMT) |
| commit | 7c2867fcb1ade429a41e030585332ea26e3f60e1 (patch) | |
| tree | 25ce59314ae0bbace00216451fbf64ea1d3a6138 /Lib/test/test_urllib.py | |
| parent | a7e734fceeeda4cd5087a0fe2f11acf8c199962c (diff) | |
| download | cpython-7c2867fcb1ade429a41e030585332ea26e3f60e1.zip cpython-7c2867fcb1ade429a41e030585332ea26e3f60e1.tar.gz cpython-7c2867fcb1ade429a41e030585332ea26e3f60e1.tar.bz2 | |
Fix for the Issue918368 - urllib doesn't correct server returned urls
Diffstat (limited to 'Lib/test/test_urllib.py')
| -rw-r--r-- | Lib/test/test_urllib.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 93921a6..eaacc39 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -598,6 +598,18 @@ class Utility_Tests(unittest.TestCase): self.assertEqual(('user', 'a:b'),urllib.splitpasswd('user:a:b')) +class URLopener_Tests(unittest.TestCase): + """Testcase to test the open method of URLopener class.""" + + def test_quoted_open(self): + class DummyURLopener(urllib.URLopener): + def open_spam(self, url): + return url + + self.assertEqual(DummyURLopener().open( + 'spam://example/ /'),'//example/%20/') + + # 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 @@ -693,6 +705,7 @@ def test_main(): urlencode_Tests, Pathname_Tests, Utility_Tests, + URLopener_Tests, #FTPWrapperTests, ) |
