@mock.patch("smtplib.SMTP")
    def test_sendmail(self, mock_SMTP):
        mock_SMTP_instance = mock_SMTP.return_value

        mailto = 'fake@email.com'
        subject = 'This is a subject'
        message = 'This is a message'
        mail.sendmail(mailto, subject, message)

        args, kwargs = mock_SMTP_instance.sendmail.call_args
        from_header = config.get('smtp.from')
        self.assertEqual(from_header, args[0])
        self.assertIn(mailto, args[1])
        self.assertIn('To: %s' % mailto, args[2])
        self.assertIn(from_header % 'From: %s', args[2])
        self.assertIn('Subject: %s' % subject, args[2])
        self.assertIn('Content-Type: text/html', args[2])
dataset/ETHPy150Open uber/clay/tests/test_mail.py/TestMail.test_sendmail/swapped operands of `%`