本文整理汇总了Python中kiwi.xml_state.XMLState.delete_repository_sections_used_for_build方法的典型用法代码示例。如果您正苦于以下问题:Python XMLState.delete_repository_sections_used_for_build方法的具体用法?Python XMLState.delete_repository_sections_used_for_build怎么用?Python XMLState.delete_repository_sections_used_for_build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.xml_state.XMLState
的用法示例。
在下文中一共展示了XMLState.delete_repository_sections_used_for_build方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import delete_repository_sections_used_for_build [as 别名]
#.........这里部分代码省略.........
assert state.get_build_type_unpartitioned_bytes() == 0
def test_get_volume_group_name(self):
assert self.state.get_volume_group_name() == 'mydisk'
def test_get_volume_group_name_default(self):
assert self.boot_state.get_volume_group_name() == 'systemVG'
def test_get_distribution_name_from_boot_attribute(self):
assert self.state.get_distribution_name_from_boot_attribute() == \
'distribution'
def test_get_fs_mount_option_list(self):
assert self.state.get_fs_mount_option_list() == ['async']
@raises(KiwiDistributionNameError)
@patch('kiwi.xml_parse.type_.get_boot')
def test_get_distribution_name_from_boot_attribute_no_boot(self, mock_boot):
mock_boot.return_value = None
self.state.get_distribution_name_from_boot_attribute()
@raises(KiwiDistributionNameError)
@patch('kiwi.xml_parse.type_.get_boot')
def test_get_distribution_name_from_boot_attribute_invalid_boot(
self, mock_boot
):
mock_boot.return_value = 'invalid'
self.state.get_distribution_name_from_boot_attribute()
def test_delete_repository_sections(self):
self.state.delete_repository_sections()
assert self.state.get_repository_sections() == []
def test_delete_repository_sections_used_for_build(self):
self.state.delete_repository_sections_used_for_build()
assert self.state.get_repository_sections()[0].get_imageonly()
def test_get_build_type_vmconfig_entries(self):
assert self.state.get_build_type_vmconfig_entries() == []
def test_get_build_type_vmconfig_entries_for_vmx_type(self):
xml_data = self.description.load()
state = XMLState(xml_data, ['vmxFlavour'], 'vmx')
assert state.get_build_type_vmconfig_entries() == [
'numvcpus = "4"', 'cpuid.coresPerSocket = "2"'
]
def test_get_build_type_vmconfig_entries_no_machine_section(self):
description = XMLDescription('../data/example_disk_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
assert state.get_build_type_vmconfig_entries() == []
def test_get_build_type_docker_containerconfig_section(self):
xml_data = self.description.load()
state = XMLState(xml_data, ['vmxFlavour'], 'docker')
containerconfig = state.get_build_type_containerconfig_section()
assert containerconfig.get_name() == \
'container_name'
assert containerconfig.get_maintainer() == \
'tux'
assert containerconfig.get_workingdir() == \
'/root'
def test_set_container_tag(self):
xml_data = self.description.load()