本文整理汇总了Python中kiwi.xml_state.XMLState.get_bootstrap_collection_type方法的典型用法代码示例。如果您正苦于以下问题:Python XMLState.get_bootstrap_collection_type方法的具体用法?Python XMLState.get_bootstrap_collection_type怎么用?Python XMLState.get_bootstrap_collection_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.xml_state.XMLState
的用法示例。
在下文中一共展示了XMLState.get_bootstrap_collection_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_bootstrap_collection_type [as 别名]
class TestXMLState(object):
@patch('platform.machine')
def setup(self, mock_machine):
mock_machine.return_value = 'x86_64'
description = XMLDescription(
'../data/example_config.xml'
)
self.state = XMLState(
description.load()
)
boot_description = XMLDescription(
'../data/isoboot/example-distribution/config.xml'
)
self.boot_state = XMLState(
boot_description.load()
)
def test_build_type_primary_selected(self):
assert self.state.get_build_type_name() == 'oem'
def test_build_type_first_selected(self):
self.state.xml_data.get_preferences()[1].get_type()[0].set_primary(
False
)
assert self.state.get_build_type_name() == 'oem'
def test_get_package_manager(self):
assert self.state.get_package_manager() == 'zypper'
def test_get_image_version(self):
assert self.state.get_image_version() == '1.13.2'
def test_get_bootstrap_packages(self):
assert self.state.get_bootstrap_packages() == [
'filesystem'
]
def test_get_system_packages(self):
assert self.state.get_system_packages() == [
'gfxboot-branding-openSUSE',
'grub2-branding-openSUSE',
'ifplugd',
'iputils',
'kernel-default',
'openssh',
'plymouth-branding-openSUSE',
'vim'
]
def test_get_system_collections(self):
assert self.state.get_system_collections() == [
'base'
]
def test_get_system_products(self):
assert self.state.get_system_products() == [
'openSUSE'
]
def test_get_system_archives(self):
assert self.state.get_system_archives() == [
'image.tgz'
]
def test_get_system_collection_type(self):
assert self.state.get_system_collection_type() == 'plusRecommended'
def test_get_bootstrap_collections(self):
assert self.state.get_bootstrap_collections() == [
'bootstrap-collection'
]
def test_get_bootstrap_products(self):
assert self.state.get_bootstrap_products() == ['kiwi']
def test_get_bootstrap_archives(self):
assert self.state.get_bootstrap_archives() == ['bootstrap.tgz']
def test_get_bootstrap_collection_type(self):
assert self.state.get_bootstrap_collection_type() == 'onlyRequired'
def test_translate_obs_to_ibs_repositories(self):
self.state.translate_obs_to_ibs_repositories()
source_path = self.state.xml_data.get_repository()[1].get_source()
assert source_path.get_path() == \
'ibs://Devel:PubCloud:AmazonEC2/SLE_12_GA'
def test_translate_obs_to_suse_repositories(self):
self.state.translate_obs_to_suse_repositories()
source_path = self.state.xml_data.get_repository()[1].get_source()
assert source_path.get_path() == \
'suse://Devel:PubCloud:AmazonEC2/SLE_12_GA'
def test_set_repository(self):
self.state.set_repository('repo', 'type', 'alias', 1)
assert self.state.xml_data.get_repository()[0].get_source().get_path() \
== 'repo'
assert self.state.xml_data.get_repository()[0].get_type() == 'type'
assert self.state.xml_data.get_repository()[0].get_alias() == 'alias'
assert self.state.xml_data.get_repository()[0].get_priority() == 1
#.........这里部分代码省略.........
示例2: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_bootstrap_collection_type [as 别名]
#.........这里部分代码省略.........
def test_get_system_archives(self):
assert self.state.get_system_archives() == [
'/absolute/path/to/image.tgz'
]
def test_get_system_ignore_packages(self):
assert self.state.get_system_ignore_packages() == [
'bar', 'baz', 'foo'
]
self.state.host_architecture = 'aarch64'
assert self.state.get_system_ignore_packages() == [
'baz', 'foo'
]
self.state.host_architecture = 's390'
assert self.state.get_system_ignore_packages() == [
'baz'
]
def test_get_system_collection_type(self):
assert self.state.get_system_collection_type() == 'plusRecommended'
def test_get_bootstrap_collections(self):
assert self.state.get_bootstrap_collections() == [
'bootstrap-collection'
]
def test_get_bootstrap_products(self):
assert self.state.get_bootstrap_products() == ['kiwi']
def test_get_bootstrap_archives(self):
assert self.state.get_bootstrap_archives() == ['bootstrap.tgz']
def test_get_bootstrap_collection_type(self):
assert self.state.get_bootstrap_collection_type() == 'onlyRequired'
def test_set_repository(self):
self.state.set_repository('repo', 'type', 'alias', 1, True, False)
assert self.state.xml_data.get_repository()[0].get_source().get_path() \
== 'repo'
assert self.state.xml_data.get_repository()[0].get_type() == 'type'
assert self.state.xml_data.get_repository()[0].get_alias() == 'alias'
assert self.state.xml_data.get_repository()[0].get_priority() == 1
assert self.state.xml_data.get_repository()[0].get_imageinclude() is True
assert self.state.xml_data.get_repository()[0].get_package_gpgcheck() is False
def test_add_repository(self):
self.state.add_repository('repo', 'type', 'alias', 1, True)
assert self.state.xml_data.get_repository()[3].get_source().get_path() \
== 'repo'
assert self.state.xml_data.get_repository()[3].get_type() == 'type'
assert self.state.xml_data.get_repository()[3].get_alias() == 'alias'
assert self.state.xml_data.get_repository()[3].get_priority() == 1
assert self.state.xml_data.get_repository()[3].get_imageinclude() is True
def test_add_repository_with_empty_values(self):
self.state.add_repository('repo', 'type', '', '', True)
assert self.state.xml_data.get_repository()[3].get_source().get_path() \
== 'repo'
assert self.state.xml_data.get_repository()[3].get_type() == 'type'
assert self.state.xml_data.get_repository()[3].get_alias() == ''
assert self.state.xml_data.get_repository()[3].get_priority() is None
assert self.state.xml_data.get_repository()[3].get_imageinclude() is True
def test_get_to_become_deleted_packages(self):
assert self.state.get_to_become_deleted_packages() == [