本文整理汇总了Python中kiwi.xml_state.XMLState.get_derived_from_image_uri方法的典型用法代码示例。如果您正苦于以下问题:Python XMLState.get_derived_from_image_uri方法的具体用法?Python XMLState.get_derived_from_image_uri怎么用?Python XMLState.get_derived_from_image_uri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.xml_state.XMLState
的用法示例。
在下文中一共展示了XMLState.get_derived_from_image_uri方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_init_with_derived_from_image
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_derived_from_image_uri [as 别名]
def test_init_with_derived_from_image(
self, mock_root_bind, mock_root_init, mock_root_import
):
description = XMLDescription(
description='../data/example_config.xml',
derived_from='derived/description'
)
xml = description.load()
root_init = mock.MagicMock()
mock_root_init.return_value = root_init
root_import = mock.Mock()
root_import.sync_data = mock.Mock()
mock_root_import.return_value = root_import
root_bind = mock.MagicMock()
root_bind.root_dir = 'root_dir'
mock_root_bind.return_value = root_bind
state = XMLState(
xml, profiles=['vmxFlavour'], build_type='docker'
)
uri = mock.Mock()
get_derived_from_image_uri = mock.Mock(
return_value=uri
)
state.get_derived_from_image_uri = get_derived_from_image_uri
SystemPrepare(
xml_state=state, root_dir='root_dir',
)
mock_root_init.assert_called_once_with(
'root_dir', False
)
root_init.create.assert_called_once_with()
mock_root_import.assert_called_once_with(
'root_dir', uri,
state.build_type.get_image()
)
root_import.sync_data.assert_called_once_with()
mock_root_bind.assert_called_once_with(
root_init
)
root_bind.setup_intermediate_config.assert_called_once_with()
root_bind.mount_kernel_file_systems.assert_called_once_with()
示例2: test_set_derived_from_image_uri
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_derived_from_image_uri [as 别名]
def test_set_derived_from_image_uri(self):
xml_data = self.description.load()
state = XMLState(xml_data, ['derivedContainer'], 'docker')
state.set_derived_from_image_uri('file:///new_uri')
assert state.get_derived_from_image_uri().translate() == '/new_uri'
示例3: test_get_derived_from_image_uri
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_derived_from_image_uri [as 别名]
def test_get_derived_from_image_uri(self):
xml_data = self.description.load()
state = XMLState(xml_data, ['derivedContainer'], 'docker')
assert state.get_derived_from_image_uri().uri == \
'obs://project/repo/image#mytag'