'If the L{Deferred} returned by L{Portal.login} fires with an
exception of any type other than L{UnauthorizedLogin}, the exception
is logged and the client is informed that the authentication attempt
has failed.'

def test_unexpectedLoginFailure(self):

    loginArgs = []
    self.server.portal = self.portalFactory(loginArgs)
    self.server.dataReceived('EHLO\r\n')
    self.transport.clear()
    self.assertServerResponse((('AUTH    LOGIN    ' + base64.b64encode('username').strip()) + '\r\n'), [('334    ' + base64.b64encode('Password\x00').strip())])
    self.assertServerResponse((base64.b64encode('password').strip() + '\r\n'), [])
    (d, credentials, mind, interfaces) = loginArgs.pop()
    d.errback(RuntimeError('Something    wrong    with    the    server'))
    self.assertEqual('451    Requested    action    aborted:    local    error    in    processing\r\n', self.transport.value())
    self.assertEqual(len(self.flushLoggedErrors(RuntimeError)), 1)
