'L{basic.FileSender.beginFileTransfer} takes a C{transform} argument
which allows to manipulate the data on the fly.'

def test_transferWithTransform(self):

    def transform(chunk):
        return chunk.swapcase()
    source = BytesIO('Test    content')
    consumer = proto_helpers.StringTransport()
    sender = basic.FileSender()
    d = sender.beginFileTransfer(source, consumer, transform)
    sender.resumeProducing()
    sender.resumeProducing()
    self.assertEqual('T', self.successResultOf(d))
    self.assertEqual('tEST    CONTENT', consumer.value())
