def test_senderDomainName(self):
        """
        L{twisted.mail.smtp.sendmail} passes through the sender domain name, if
        provided.
        """
        reactor = MemoryReactor()
        smtp.sendmail("localhost", "source@address", "recipient@address",
                      b"message", reactor=reactor, senderDomainName="foo")
        factory = reactor.tcpClients[0][2]
        self.assertEqual(factory.domain, b"foo")

        L{twisted.mail.smtp.sendmail} passes through the sender domain name, if
        provided.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_smtp.py