本文整理汇总了Python中atomic_reactor.build.InsideBuilder.set_base_image方法的典型用法代码示例。如果您正苦于以下问题:Python InsideBuilder.set_base_image方法的具体用法?Python InsideBuilder.set_base_image怎么用?Python InsideBuilder.set_base_image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atomic_reactor.build.InsideBuilder
的用法示例。
在下文中一共展示了InsideBuilder.set_base_image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parent_images
# 需要导入模块: from atomic_reactor.build import InsideBuilder [as 别名]
# 或者: from atomic_reactor.build.InsideBuilder import set_base_image [as 别名]
def test_parent_images(parents_pulled, tmpdir, source_params):
if MOCK:
mock_docker()
s = get_source_instance_for(source_params)
b = InsideBuilder(s, '')
orig_base = b.base_image
if not b.base_from_scratch:
assert orig_base in b.parent_images
assert b.parent_images[orig_base] is None
b.set_base_image("spam:eggs", parents_pulled=parents_pulled)
assert b.parent_images[orig_base] == ImageName.parse("spam:eggs")
assert b.parents_pulled == parents_pulled
示例2: test_parent_images_to_str
# 需要导入模块: from atomic_reactor.build import InsideBuilder [as 别名]
# 或者: from atomic_reactor.build.InsideBuilder import set_base_image [as 别名]
def test_parent_images_to_str(tmpdir, caplog):
if MOCK:
mock_docker()
source = {'provider': 'path', 'uri': 'file://' + DOCKERFILE_OK_PATH, 'tmpdir': str(tmpdir)}
b = InsideBuilder(get_source_instance_for(source), 'built-img')
b.set_base_image("spam")
b.parent_images["bacon"] = None
expected_results = {
"fedora:latest": "spam:latest"
}
assert b.parent_images_to_str() == expected_results
assert "None in: base bacon has parent None" in caplog.text