diff options
| author | Kurt B. Kaiser <kbk@shore.net> | 2004-07-11 17:14:13 (GMT) |
|---|---|---|
| committer | Kurt B. Kaiser <kbk@shore.net> | 2004-07-11 17:14:13 (GMT) |
| commit | 3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1 (patch) | |
| tree | 018792e0ef797856de01a1e29872a816117ca6cd /Lib/test/test_urllib2.py | |
| parent | e2465087790ecd3a873252a0b7c67772ce1ac911 (diff) | |
| download | cpython-3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1.zip cpython-3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1.tar.gz cpython-3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1.tar.bz2 | |
Patch [ 972332 ] urllib2 FTPHandler bugs / John J. Lee
Modified Files:
urllib2.py test/test_urllib2.py
Diffstat (limited to 'Lib/test/test_urllib2.py')
| -rw-r--r-- | Lib/test/test_urllib2.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 27b5038..6e9901f 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -314,15 +314,12 @@ class HandlerTests(unittest.TestCase): ("ftp://localhost/foo/bar/baz.html", "localhost", ftplib.FTP_PORT, "I", ["foo", "bar"], "baz.html", "text/html"), -# XXXX Bug: FTPHandler tries to gethostbyname "localhost:80", with the -# port still there. -## ("ftp://localhost:80/foo/bar/", -## "localhost", 80, "D", -## ["foo", "bar"], "", None), -# XXXX bug: second use of splitattr() in FTPHandler should be splitvalue() -## ("ftp://localhost/baz.gif;type=a", -## "localhost", ftplib.FTP_PORT, "A", -## [], "baz.gif", "image/gif"), + ("ftp://localhost:80/foo/bar/", + "localhost", 80, "D", + ["foo", "bar"], "", None), + ("ftp://localhost/baz.gif;type=a", + "localhost", ftplib.FTP_PORT, "A", + [], "baz.gif", None), # XXX really this should guess image/gif ]: r = h.ftp_open(Request(url)) # ftp authentication not yet implemented by FTPHandler @@ -333,7 +330,7 @@ class HandlerTests(unittest.TestCase): self.assertEqual(h.ftpwrapper.filename, filename) self.assertEqual(h.ftpwrapper.filetype, type_) headers = r.info() - self.assertEqual(headers["Content-type"], mimetype) + self.assertEqual(headers.get("Content-type"), mimetype) self.assertEqual(int(headers["Content-length"]), len(data)) def test_file(self): |
