test_keystone.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:ceph-lcm 作者: Mirantis 项目源码 文件源码
def test_logout(mocked_authenticator, configure_model,
                sudo_user_with_external_id):
    now, expired = make_now_expired()
    mock = mocked_authenticator.client.get_raw_token_from_identity_service
    mock.return_value = make_token_data(
        sudo_user_with_external_id, now, expired)
    model = mocked_authenticator.authenticate("sudo", "sudo")
    mocked_authenticator.client.tokens.revoke_token.assert_not_called()

    mocked_authenticator.logout(model)
    mocked_authenticator.client.tokens.revoke_token.assert_called_once_with(
        model.model_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号