#NEWLINE# def test_bodyDataFinishedBeforeStartProducing( self ) : #NEWLINE# #INDENT# "\n        If the entire body is delivered to the L{Response} before the\n        response's C{deliverBody} method is called, the protocol passed to\n        C{deliverBody} is immediately given the body data and then\n        disconnected.\n        " #NEWLINE# transport = StringTransport ( ) #NEWLINE# response = justTransportResponse ( transport ) #NEWLINE# response . _bodyDataReceived ( b'foo' ) #NEWLINE# response . _bodyDataReceived ( b'bar' ) #NEWLINE# response . _bodyDataFinished ( ) #NEWLINE# protocol = AccumulatingProtocol ( ) #NEWLINE# response . deliverBody ( protocol ) #NEWLINE# self . assertEqual ( protocol . data , b'foobar' ) #NEWLINE# protocol . closedReason . trap ( ResponseDone )