'L{basic.FileSender} reads at most C{CHUNK_SIZE} every time it resumes
producing.'

def test_transferMultipleChunks(self):

    source = BytesIO('Test    content')
    consumer = proto_helpers.StringTransport()
    sender = basic.FileSender()
    sender.CHUNK_SIZE = 4
    d = sender.beginFileTransfer(source, consumer)
    sender.resumeProducing()
    self.assertEqual('Test', consumer.value())
    sender.resumeProducing()
    self.assertEqual('Test    con', consumer.value())
    sender.resumeProducing()
    self.assertEqual('Test    content', consumer.value())
    sender.resumeProducing()
    self.assertEqual('t', self.successResultOf(d))
    self.assertEqual('Test    content', consumer.value())
