'If the entire body is delivered to the L{Response} before the
response\'s C{deliverBody} method is called, the protocol passed to
C{deliverBody} is immediately given the body data and then
disconnected.'

def test_bodyDataFinishedBeforeStartProducing(self):

    transport = StringTransport()
    response = justTransportResponse(transport)
    response._bodyDataReceived('foo')
    response._bodyDataReceived('bar')
    response._bodyDataFinished()
    protocol = AccumulatingProtocol()
    response.deliverBody(protocol)
    self.assertEqual(protocol.data, 'foobar')
    protocol.closedReason.trap(ResponseDone)
