#NEWLINE# def test_parserDataReceivedException( self ) : #NEWLINE# #INDENT# "\n        If the parser L{HTTP11ClientProtocol} delivers bytes to in\n        C{dataReceived} raises an exception, the exception is wrapped in a\n        L{Failure} and passed to the parser's C{connectionLost} and then the\n        L{HTTP11ClientProtocol}'s transport is disconnected.\n        " #NEWLINE# requestDeferred = self . protocol . request ( Request ( b'GET' , b'/' , _boringHeaders , None ) ) #NEWLINE# self . protocol . dataReceived ( b'unparseable garbage goes here\r\n' ) #NEWLINE# d = assertResponseFailed ( self , requestDeferred , [ ParseError ] ) #NEWLINE# def cbFailed( exc ) : #NEWLINE# #INDENT# self . assertTrue ( self . transport . disconnecting ) #NEWLINE# self . assertEqual ( exc . reasons [ 0 ] . value . data , b'unparseable garbage goes here' ) #NEWLINE# self . protocol . connectionLost ( Failure ( ConnectionDone ( 'it is done' ) ) ) #NEWLINE# #UNINDENT# d . addCallback ( cbFailed ) #NEWLINE# return d