def test_bodyDataFinishedAfterDeliveryFails(self):
        """
        L{Response._bodyDataFinished} raises L{RuntimeError} if called after
        the body has been delivered.
        """
        response = justTransportResponse(StringTransport())
        response._bodyDataFinished()
        response.deliverBody(Protocol())
        self.assertRaises(RuntimeError, response._bodyDataFinished)

        L{Response._bodyDataFinished} raises L{RuntimeError} if called after
        the body has been delivered.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_newclient.py