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"))]
评论列表
文章目录