本文整理汇总了Python中kiwi.xml_state.XMLState.get_volumes方法的典型用法代码示例。如果您正苦于以下问题:Python XMLState.get_volumes方法的具体用法?Python XMLState.get_volumes怎么用?Python XMLState.get_volumes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.xml_state.XMLState
的用法示例。
在下文中一共展示了XMLState.get_volumes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_volumes_no_explicit_root_setup_other_fullsize_volume
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
def test_get_volumes_no_explicit_root_setup_other_fullsize_volume(self):
description = XMLDescription(
'../data/example_lvm_no_root_full_usr_config.xml'
)
xml_data = description.load()
state = XMLState(xml_data)
volume_type = namedtuple(
'volume_type', [
'name',
'size',
'realpath',
'mountpoint',
'fullsize'
]
)
assert state.get_volumes() == [
volume_type(
name='LVusr', size=None, realpath='usr',
mountpoint=None, fullsize=True
),
volume_type(
name='LVRoot', size='freespace:30', realpath='/',
mountpoint=None, fullsize=False
)
]
示例2: test_get_volumes
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
def test_get_volumes(self):
description = XMLDescription('../data/example_lvm_default_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
volume_type = namedtuple(
'volume_type', [
'name',
'size',
'realpath',
'mountpoint',
'fullsize'
]
)
assert state.get_volumes() == [
volume_type(
name='LVusr_lib', size='size:1024',
realpath='usr/lib',
mountpoint=None, fullsize=False
),
volume_type(
name='LVRoot', size='freespace:500',
realpath='/',
mountpoint=None, fullsize=False
),
volume_type(
name='etc_volume', size='freespace:30',
realpath='etc',
mountpoint='LVetc', fullsize=False
),
volume_type(
name='bin_volume', size=None,
realpath='/usr/bin',
mountpoint='LVusr_bin', fullsize=True
)
]
示例3: test_get_volumes_no_explicit_root_setup
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
def test_get_volumes_no_explicit_root_setup(self):
description = XMLDescription('../data/example_lvm_no_root_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
volume_type = namedtuple(
'volume_type', [
'name',
'size',
'realpath',
'mountpoint',
'fullsize',
'attributes'
]
)
assert state.get_volumes() == [
volume_type(
name='LVRoot', size=None, realpath='/',
mountpoint=None, fullsize=True,
attributes=[]
)
]
示例4: test_get_volumes_invalid_name_for_shell
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
def test_get_volumes_invalid_name_for_shell(self):
description = XMLDescription('../data/example_lvm_invalid_config.xml')
xml_data = description.load()
state = XMLState(xml_data, ['invalid_volume_c'])
state.get_volumes()
示例5: test_get_volumes_invalid_mountpoint
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
def test_get_volumes_invalid_mountpoint(self):
description = XMLDescription('../data/example_lvm_invalid_config.xml')
xml_data = description.load()
state = XMLState(xml_data, ['invalid_volume_b'])
state.get_volumes()
示例6: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
#.........这里部分代码省略.........
state = XMLState(xml_data)
assert state.get_volume_management() == 'btrfs'
def test_get_volume_management_lvm_prefer(self):
description = XMLDescription('../data/example_lvm_preferred_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
assert state.get_volume_management() == 'lvm'
def test_get_volume_management_lvm_default(self):
description = XMLDescription('../data/example_lvm_default_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
assert state.get_volume_management() == 'lvm'
def test_build_type_explicitly_selected(self):
description = XMLDescription('../data/example_config.xml')
xml_data = description.load()
state = XMLState(xml_data, ['vmxFlavour'], 'vmx')
assert state.get_build_type_name() == 'vmx'
@raises(KiwiTypeNotFound)
def test_build_type_not_found(self):
description = XMLDescription('../data/example_config.xml')
xml_data = description.load()
XMLState(xml_data, ['vmxFlavour'], 'foo')
@raises(KiwiProfileNotFound)
def test_profile_not_found(self):
description = XMLDescription('../data/example_config.xml')
xml_data = description.load()
XMLState(xml_data, ['foo'])
def test_get_volumes(self):
description = XMLDescription('../data/example_lvm_default_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
volume_type = namedtuple(
'volume_type', [
'name',
'size',
'realpath',
'mountpoint',
'fullsize'
]
)
assert state.get_volumes() == [
volume_type(
name='LVusr_lib', size='size:1024',
realpath='usr/lib',
mountpoint=None, fullsize=False
),
volume_type(
name='LVRoot', size='freespace:500',
realpath='/',
mountpoint=None, fullsize=False
),
volume_type(
name='etc_volume', size='freespace:30',
realpath='etc',
mountpoint='LVetc', fullsize=False
),
volume_type(
name='bin_volume', size=None,
realpath='/usr/bin',
mountpoint='LVusr_bin', fullsize=True
示例7: TestXMLState
# 需要导入模块: from kiwi.xml_state import XMLState [as 别名]
# 或者: from kiwi.xml_state.XMLState import get_volumes [as 别名]
#.........这里部分代码省略.........
description = XMLDescription('../data/example_lvm_default_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
assert state.get_volume_management() == 'lvm'
def test_build_type_explicitly_selected(self):
xml_data = self.description.load()
state = XMLState(xml_data, ['vmxFlavour'], 'vmx')
assert state.get_build_type_name() == 'vmx'
@raises(KiwiTypeNotFound)
def test_build_type_not_found(self):
xml_data = self.description.load()
XMLState(xml_data, ['vmxFlavour'], 'foo')
@raises(KiwiTypeNotFound)
def test_build_type_not_found_no_default_type(self):
description = XMLDescription('../data/example_no_default_type.xml')
xml_data = description.load()
XMLState(xml_data, ['minimal'])
@raises(KiwiProfileNotFound)
def test_profile_not_found(self):
xml_data = self.description.load()
XMLState(xml_data, ['foo'])
def test_profile_requires(self):
xml_data = self.description.load()
xml_state = XMLState(xml_data, ['composedProfile'])
assert xml_state.profiles == [
'composedProfile', 'vmxFlavour', 'xenFlavour'
]
def test_get_volumes(self):
description = XMLDescription('../data/example_lvm_default_config.xml')
xml_data = description.load()
state = XMLState(xml_data)
volume_type = namedtuple(
'volume_type', [
'name',
'size',
'realpath',
'mountpoint',
'fullsize',
'attributes'
]
)
assert state.get_volumes() == [
volume_type(
name='usr_lib', size='size:1024',
realpath='usr/lib',
mountpoint='usr/lib', fullsize=False,
attributes=[]
),
volume_type(
name='LVRoot', size='freespace:500',
realpath='/',
mountpoint=None, fullsize=False,
attributes=[]
),
volume_type(
name='etc_volume', size='freespace:30',
realpath='etc',
mountpoint='etc', fullsize=False,
attributes=['no-copy-on-write']
),