#NEWLINE# def test_malformed_header( self ) : #NEWLINE# #INDENT# if ( self . scheme == 'https' ) : #NEWLINE# #INDENT# c = HTTPSConnection ( ( '%s:%s' % ( self . interface ( ) , self . PORT ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# c = HTTPConnection ( ( '%s:%s' % ( self . interface ( ) , self . PORT ) ) ) #NEWLINE# #UNINDENT# c . putrequest ( 'GET' , '/' ) #NEWLINE# c . putheader ( 'Content-Type' , 'text/plain' ) #NEWLINE# c . _output ( ntob ( 'Re, 1.2.3.4#015#012' ) ) #NEWLINE# c . endheaders ( ) #NEWLINE# response = c . getresponse ( ) #NEWLINE# self . status = str ( response . status ) #NEWLINE# self . assertStatus ( 400 ) #NEWLINE# self . body = response . fp . read ( 20 ) #NEWLINE# self . assertBody ( 'Illegal header line.' )