'L{smtp.SenderMixin.sentMail} adds only the addresses with failing
SMTP response codes to the log passed to the factory\'s errback.'

def test_onlyLogFailedAddresses(self):

    onDone = self.assertFailure(defer.Deferred(), smtp.SMTPDeliveryError)
    onDone.addCallback((lambda e: self.assertEqual(e.log, 'bob@example.com:    199    Error    in    sending.\n')))
    clientFactory = smtp.SMTPSenderFactory('source@address', 'recipient@address', BytesIO('Message    body'), onDone, retries=0, timeout=0.5)
    client = clientFactory.buildProtocol(address.IPv4Address('TCP', 'example.net', 25))
    addresses = [('alice@example.com', 200, 'No    errors    here!'), ('bob@example.com', 199, 'Error    in    sending.')]
    client.sentMail(199, 'Test    response', 1, addresses, client.log)
    return onDone
