@@ -314,15 +314,12 @@ def connect_ftp(self, user, passwd, host, port, dirs):
314314 ("ftp://localhost/foo/bar/baz.html" ,
315315 "localhost" , ftplib .FTP_PORT , "I" ,
316316 ["foo" , "bar" ], "baz.html" , "text/html" ),
317- # XXXX Bug: FTPHandler tries to gethostbyname "localhost:80", with the
318- # port still there.
319- ## ("ftp://localhost:80/foo/bar/",
320- ## "localhost", 80, "D",
321- ## ["foo", "bar"], "", None),
322- # XXXX bug: second use of splitattr() in FTPHandler should be splitvalue()
323- ## ("ftp://localhost/baz.gif;type=a",
324- ## "localhost", ftplib.FTP_PORT, "A",
325- ## [], "baz.gif", "image/gif"),
317+ ("ftp://localhost:80/foo/bar/" ,
318+ "localhost" , 80 , "D" ,
319+ ["foo" , "bar" ], "" , None ),
320+ ("ftp://localhost/baz.gif;type=a" ,
321+ "localhost" , ftplib .FTP_PORT , "A" ,
322+ [], "baz.gif" , None ), # XXX really this should guess image/gif
326323 ]:
327324 r = h .ftp_open (Request (url ))
328325 # ftp authentication not yet implemented by FTPHandler
@@ -333,7 +330,7 @@ def connect_ftp(self, user, passwd, host, port, dirs):
333330 self .assertEqual (h .ftpwrapper .filename , filename )
334331 self .assertEqual (h .ftpwrapper .filetype , type_ )
335332 headers = r .info ()
336- self .assertEqual (headers [ "Content-type" ] , mimetype )
333+ self .assertEqual (headers . get ( "Content-type" ) , mimetype )
337334 self .assertEqual (int (headers ["Content-length" ]), len (data ))
338335
339336 def test_file (self ):
0 commit comments