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