def test_connectionLostWithError(self):
        transport = StringTransport()
        protocol = HTTPClientParser(Request('GET', '/', _boringHeaders, None),
                                    None)
        protocol.makeConnection(transport)

        response = []
        protocol._responseDeferred.addCallback(response.append)
        protocol.dataReceived(
            'HTTP/1.1 200 OK\r\n'
            'Content-Length: 1\r\n'
            '\r\n')
        response = response[0]

        # Arrange for an exception
        def fakeBodyDataFinished(err=None):
            raise ArbitraryException()
        response._bodyDataFinished = fakeBodyDataFinished

        protocol.connectionLost(None)

        self.assertEqual(len(self.flushLoggedErrors(ArbitraryException)), 1)
If one of the L{Response} methods called by
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/test/test_newclient.py/HTTPClientParserTests.test_connectionLostWithError