'L{basic.FileSender} sends the content of the given file using a
C{IConsumer} interface via C{beginFileTransfer}. It returns a
L{Deferred} which fires with the last byte sent.'

def test_transfer(self):

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