当前位置: 首页>>代码示例>>Python>>正文


Python XMLState.get_volumes方法代码示例

本文整理汇总了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
         )
     ]
开发者ID:toabctl,项目名称:kiwi,代码行数:27,代码来源:xml_state_test.py

示例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
         )
     ]
开发者ID:toabctl,项目名称:kiwi,代码行数:37,代码来源:xml_state_test.py

示例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=[]
         )
     ]
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:23,代码来源:xml_state_test.py

示例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()
开发者ID:toabctl,项目名称:kiwi,代码行数:7,代码来源:xml_state_test.py

示例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()
开发者ID:toabctl,项目名称:kiwi,代码行数:7,代码来源:xml_state_test.py

示例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
开发者ID:toabctl,项目名称:kiwi,代码行数:70,代码来源:xml_state_test.py

示例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']
            ),
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:70,代码来源:xml_state_test.py


注:本文中的kiwi.xml_state.XMLState.get_volumes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。