test_region.py 文件源码

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

项目:meta-maas 作者: maas 项目源码 文件源码
def test_Region_sync_custom_image_already_synced(tmpdir):
    """Test Region.sync_custom performs create and handles when its already
    synced."""
    region = make_Region()
    image_path = tmpdir.join("image.tar.gz")
    image_path.write(b"data")
    region.sync_custom("image", {
        "path": str(image_path),
        "architecture": "amd64/generic",
        "title": "My Title",
    })
    assert call(
        "custom/image", "amd64/generic", ANY,
        title="My Title", filetype=BootResourceFileType.TGZ,
        progress_callback=ANY) == region.origin.BootResources.create.call_args
    assert (
        call("custom/image already in sync", level=MessageLevel.SUCCESS) ==
        region.print_msg.call_args)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号