本文整理汇总了Python中kiwi.xml_state.XMLState.get_build_type_oemconfig_section方法的典型用法代码示例。如果您正苦于以下问题:Python XMLState.get_build_type_oemconfig_section方法的具体用法?Python XMLState.get_build_type_oemconfig_section怎么用?Python XMLState.get_build_type_oemconfig_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.xml_state.XMLState
的用法示例。
在下文中一共展示了XMLState.get_build_type_oemconfig_section方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_build_type_oemconfig_section
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_build_type_oemconfig_section [as 别名]
def test_get_build_type_oemconfig_section(self):
description = XMLDescription('../data/example_config.xml')
xml_data = description.load()
state = XMLState(xml_data, None, 'oem')
assert state.get_build_type_oemconfig_section().get_oem_swap()[0] ==\
'true'
示例2: test_get_build_type_oemconfig_section
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_build_type_oemconfig_section [as 别名]
def test_get_build_type_oemconfig_section(self):
xml_data = self.description.load()
state = XMLState(xml_data, None, 'oem')
assert state.get_build_type_oemconfig_section().get_oem_swap()[0] is \
True
示例3: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_build_type_oemconfig_section [as 别名]
#.........这里部分代码省略.........
state.get_volumes()
@patch('kiwi.xml_state.XMLState.get_build_type_system_disk_section')
def test_get_empty_volumes(self, mock_system_disk):
mock_system_disk.return_value = None
assert self.state.get_volumes() == []
def test_get_strip_files_to_delete(self):
assert self.state.get_strip_files_to_delete() == ['del-a', 'del-b']
def test_get_strip_tools_to_keep(self):
assert self.state.get_strip_tools_to_keep() == ['tool-a', 'tool-b']
def test_get_strip_libraries_to_keep(self):
assert self.state.get_strip_libraries_to_keep() == ['lib-a', 'lib-b']
def test_get_build_type_machine_section(self):
description = XMLDescription('../data/example_config.xml')
xml_data = description.load()
state = XMLState(xml_data, None, 'vmx')
assert state.get_build_type_machine_section().get_guestOS() == 'suse'
def test_get_build_type_pxedeploy_section(self):
description = XMLDescription('../data/example_pxe_config.xml')
xml_data = description.load()
state = XMLState(xml_data, None, 'pxe')
assert state.get_build_type_pxedeploy_section().get_server() == \
'192.168.100.2'
def test_get_drivers_list(self):
assert self.state.get_drivers_list() == \
['crypto/*', 'drivers/acpi/*', 'bar']
def test_get_build_type_oemconfig_section(self):
description = XMLDescription('../data/example_config.xml')
xml_data = description.load()
state = XMLState(xml_data, None, 'oem')
assert state.get_build_type_oemconfig_section().get_oem_swap()[0] ==\
'true'
def test_get_users_sections(self):
assert self.state.get_users_sections()[0].get_user()[0].get_name() == \
'root'
def test_get_users(self):
assert self.state.get_users()[0].user_sections[0].get_name() == \
'root'
def test_copy_displayname(self):
self.state.copy_displayname(self.boot_state)
assert self.boot_state.xml_data.get_displayname() == 'Bob'
def test_copy_drivers_sections(self):
self.state.copy_drivers_sections(self.boot_state)
assert 'bar' in self.boot_state.get_drivers_list()
def test_copy_systemdisk_section(self):
self.state.copy_systemdisk_section(self.boot_state)
systemdisk = self.boot_state.get_build_type_system_disk_section()
assert systemdisk.get_name() == 'mydisk'
def test_copy_strip_sections(self):
self.state.copy_strip_sections(self.boot_state)
assert 'del-a' in self.boot_state.get_strip_files_to_delete()
def test_copy_machine_section(self):
示例4: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_build_type_oemconfig_section [as 别名]
#.........这里部分代码省略.........
)
]
@patch('kiwi.xml_state.XMLState.get_build_type_system_disk_section')
def test_get_empty_volumes(self, mock_system_disk):
mock_system_disk.return_value = None
assert self.state.get_volumes() == []
def test_get_strip_files_to_delete(self):
assert self.state.get_strip_files_to_delete() == ['del-a', 'del-b']
def test_get_strip_tools_to_keep(self):
assert self.state.get_strip_tools_to_keep() == ['tool-a', 'tool-b']
def test_get_strip_libraries_to_keep(self):
assert self.state.get_strip_libraries_to_keep() == ['lib-a', 'lib-b']
def test_get_build_type_machine_section(self):
xml_data = self.description.load()
state = XMLState(xml_data, None, 'vmx')
assert state.get_build_type_machine_section().get_guestOS() == 'suse'
def test_get_build_type_pxedeploy_section(self):
description = XMLDescription('../data/example_pxe_config.xml')
xml_data = description.load()
state = XMLState(xml_data, None, 'pxe')
assert state.get_build_type_pxedeploy_section().get_server() == \
'192.168.100.2'
def test_get_drivers_list(self):
assert self.state.get_drivers_list() == \
['crypto/*', 'drivers/acpi/*', 'bar']
def test_get_build_type_oemconfig_section(self):
xml_data = self.description.load()
state = XMLState(xml_data, None, 'oem')
assert state.get_build_type_oemconfig_section().get_oem_swap()[0] is \
True
def test_get_users_sections(self):
assert self.state.get_users_sections()[0].get_user()[0].get_name() == \
'root'
def test_get_users(self):
description = XMLDescription('../data/example_multiple_users_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
users = state.get_users()
assert len(users) == 3
assert any(u.get_name() == 'root' for u in users)
assert any(u.get_name() == 'tux' for u in users)
assert any(u.get_name() == 'kiwi' for u in users)
def test_get_user_groups(self):
description = XMLDescription('../data/example_multiple_users_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
assert len(state.get_user_groups('root')) == 0
assert len(state.get_user_groups('tux')) == 1
assert any(grp == 'users' for grp in state.get_user_groups('tux'))
assert len(state.get_user_groups('kiwi')) == 3
assert any(grp == 'users' for grp in state.get_user_groups('kiwi'))
assert any(grp == 'kiwi' for grp in state.get_user_groups('kiwi'))
assert any(grp == 'admin' for grp in state.get_user_groups('kiwi'))