test_cinder_integration.py 文件源码

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

项目:ceph-lcm 作者: Mirantis 项目源码 文件源码
def test_prepare_api_response(new_cluster):
    integration = cinder_integration.CinderIntegration.find_one(
        new_cluster.model_id
    )
    integration.config = "config"
    integration.keyrings["images.keyring"] = "[client.images]\n\tkey = 111"
    integration.keyrings["vols.keyring"] = "[client.vols]\n\tkey = 22"

    root_path = pathlib.PosixPath(pytest.faux.gen_alphanumeric())
    response = integration.prepare_api_response(str(root_path))

    assert str(root_path.joinpath("ceph.conf")) in response
    assert str(root_path.joinpath("images.keyring")) in response
    assert str(root_path.joinpath("vols.keyring")) in response
    assert len(response) == 3

    assert response[str(root_path.joinpath("images.keyring"))] == \
        integration.keyrings["images.keyring"]
    assert response[str(root_path.joinpath("vols.keyring"))] == \
        integration.keyrings["vols.keyring"]

    assert "[client.images]" in response[str(root_path.joinpath("ceph.conf"))]
    assert "[client.vols]" in response[str(root_path.joinpath("ceph.conf"))]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号