'If the parser L{HTTP11ClientProtocol} delivers bytes to in
C{dataReceived} raises an exception, the exception is wrapped in a
L{Failure} and passed to the parser\'s C{connectionLost} and then the
L{HTTP11ClientProtocol}\'s transport is disconnected.'

def test_parserDataReceivedException(self):

    requestDeferred = self.protocol.request(Request('GET', '/', _boringHeaders, None))
    self.protocol.dataReceived('unparseable    garbage    goes    here\r\n')
    d = assertResponseFailed(self, requestDeferred, [ParseError])
    def cbFailed(exc):
        self.assertTrue(self.transport.disconnecting)
        self.assertEqual(exc.reasons[0].value.data, 'unparseable    garbage    goes    here')
        self.protocol.connectionLost(Failure(ConnectionDone(u'it    is    done')))
    d.addCallback(cbFailed)
    return d
