'L{smtp.SMTPSenderFactory} removes the current protocol when the client
connection is failed.'

def test_removeCurrentProtocolWhenClientConnectionFailed(self):

    reactor = MemoryReactor()
    sentDeferred = defer.Deferred()
    clientFactory = smtp.SMTPSenderFactory('source@address', 'recipient@address', BytesIO('message'), sentDeferred)
    connector = reactor.connectTCP('localhost', 25, clientFactory)
    clientFactory.buildProtocol(None)
    clientFactory.clientConnectionFailed(connector, error.ConnectionDone('Bye.'))
    self.assertEqual(clientFactory.currentProtocol, None)
