def test_messageFilePassthrough(self):
        """
        L{twisted.mail.smtp.sendmail} will pass through the message untouched
        if it is a file-like object.
        """
        reactor = MemoryReactor()
        messageFile = BytesIO(b"File!")

        smtp.sendmail("localhost", "source@address", "recipient@address",
                      messageFile, reactor=reactor)
        factory = reactor.tcpClients[0][2]
        self.assertIs(factory.file, messageFile)

        L{twisted.mail.smtp.sendmail} will pass through the message untouched
        if it is a file-like object.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_smtp.py