'Exceptions raised while verifying the key should be normalized into an
C{UnauthorizedLogin} failure.'

def test_requestAvatarIdNormalizeException(self):

    def _checkKey(ignored):
        return True
    self.patch(self.checker, 'checkKey', _checkKey)
    credentials = SSHPrivateKey('test', None, 'blob', 'sigData', 'sig')
    d = self.checker.requestAvatarId(credentials)
    def _verifyLoggedException(failure):
        errors = self.flushLoggedErrors(keys.BadKeyError)
        self.assertEqual(len(errors), 1)
        return failure
    d.addErrback(_verifyLoggedException)
    return self.assertFailure(d, UnauthorizedLogin)
