def test_finishedWithErrorWhenInitial(self):
        transport = StringTransport()
        response = justTransportResponse(transport)

        # Sanity check - this test is for the initial state
        self.assertEqual(response._state, u'INITIAL')
        response._bodyDataFinished(Failure(ArbitraryException()))

        protocol = AccumulatingProtocol()
        response.deliverBody(protocol)

        protocol.closedReason.trap(ArbitraryException)
The L{Failure} passed to L{Response._bodyDataFinished} when the response
dataset/ETHPy150Open twisted/twisted/twisted/web/test/test_newclient.py/ResponseTests.test_finishedWithErrorWhenInitial