'If L{SSHPublicKeyDatabase.checkKey} returns False,
C{_cbRequestAvatarId} should raise L{UnauthorizedLogin}.'

def test_requestAvatarIdInvalidKey(self):

    def _checkKey(ignored):
        return False
    self.patch(self.checker, 'checkKey', _checkKey)
    d = self.checker.requestAvatarId(None)
    return self.assertFailure(d, UnauthorizedLogin)
