def test_resumeProducingBuffersOutput(self):
    "\n        L{MultipleRangeStaticProducer.start} writes about\n        C{abstract.FileDescriptor.bufferSize} bytes of content from the\n        resource to the request at once.\n\n        To be specific about the 'about' above: it can write slightly more,\n        for example in the case where the first boundary plus the first chunk\n        is less than C{bufferSize} but first boundary plus the first chunk\n        plus the second boundary is more, but this is unimportant as in\n        practice the boundaries are fairly small.  On the other side, it is\n        important for performance to bundle up several small chunks into one\n        call to request.write.\n        "
    request = DummyRequest([])
    content = (b'0123456789' * 2)
    producer = static.MultipleRangeStaticProducer(request, StringIO(content), [(b'a', 0, 2), (b'b', 5, 10), (b'c', 0, 0)])
    producer.bufferSize = 10
    producer.start()
    expected = [(((b'a' + content[0:2]) + b'b') + content[5:11]), (content[11:15] + b'c')]
    self.assertEqual(expected, request.written)
L{MultipleRangeStaticProducer.start} writes about
C{abstract.FileDescriptor.bufferSize} bytes of content from the
resource to the request at once.

To be specific about the 'about' above: it can write slightly more,
for example in the case where the first boundary plus the first chunk
is less than C{bufferSize} but first boundary plus the first chunk
plus the second boundary is more, but this is unimportant as in
practice the boundaries are fairly small.  On the other side, it is
important for performance to bundle up several small chunks into one
call to request.write.
def test_resumeProducingBuffersOutput(self):
    "\n        L{MultipleRangeStaticProducer.start} writes about\n        C{abstract.FileDescriptor.bufferSize} bytes of content from the\n        resource to the request at once.\n\n        To be specific about the 'about' above: it can write slightly more,\n        for example in the case where the first boundary plus the first chunk\n        is less than C{bufferSize} but first boundary plus the first chunk\n        plus the second boundary is more, but this is unimportant as in\n        practice the boundaries are fairly small.  On the other side, it is\n        important for performance to bundle up several small chunks into one\n        call to request.write.\n        "
    request = DummyRequest([])
    content = (b'0123456789' * 2)
    producer = static.MultipleRangeStaticProducer(request, StringIO(content), [(b'a', 0, 2), (b'b', 5, 10), (b'c', 0, 0)])
    producer.bufferSize = 10
    producer.start()
    expected = [(((b'a' + content[0:2]) + b'b') + content[5:11]), (content[11:15] + b'c')]
    self.assertEqual(expected, request.written)