#NEWLINE# def test_garbage_in( self ) : #NEWLINE# #INDENT# c = HTTPConnection ( ( '%s:%s' % ( self . interface ( ) , self . PORT ) ) ) #NEWLINE# c . _output ( ntob ( 'gjkgjklsgjklsgjkljklsg' ) ) #NEWLINE# c . _send_output ( ) #NEWLINE# response = c . response_class ( c . sock , method = 'GET' ) #NEWLINE# try : #NEWLINE# #INDENT# response . begin ( ) #NEWLINE# self . assertEqual ( response . status , 400 ) #NEWLINE# self . assertEqual ( response . fp . read ( 22 ) , ntob ( 'Malformed Request-Line' ) ) #NEWLINE# c . close ( ) #NEWLINE# #UNINDENT# except socket . error : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# if ( e . errno != errno . ECONNRESET ) : #NEWLINE# #INDENT# raise