#NEWLINE# def test_connectionLostBeforeBody( self ) : #NEWLINE# #INDENT# '\n        If L{HTTPClientParser.connectionLost} is called before the headers are\n        finished, the C{_responseDeferred} is fired with the L{Failure} passed\n        to C{connectionLost}.\n        ' #NEWLINE# transport = StringTransport ( ) #NEWLINE# protocol = HTTPClientParser ( Request ( b'GET' , b'/' , _boringHeaders , None ) , None ) #NEWLINE# protocol . makeConnection ( transport ) #NEWLINE# responseDeferred = protocol . _responseDeferred #NEWLINE# protocol . connectionLost ( Failure ( ArbitraryException ( ) ) ) #NEWLINE# return assertResponseFailed ( self , responseDeferred , [ ArbitraryException ] )