kiwi-el8/test/unit/partitioner/base_test.py
Marcus Schäfer 2540d56602
Add support for discoverable partitions
Set PARTUUID according to systemd-id128 if applicable
This Fixes #1385
2024-02-26 09:42:01 +01:00

47 lines
1.3 KiB
Python

from unittest.mock import Mock
from pytest import raises
from kiwi.partitioner.base import PartitionerBase
class TestPartitionerBase:
def setup(self):
disk_provider = Mock()
disk_provider.get_device = Mock(
return_value='/dev/loop0'
)
self.partitioner = PartitionerBase(disk_provider)
def setup_method(self, cls):
self.setup()
def test_get_id(self):
assert self.partitioner.get_id() == 0
def test_set_uuid(self):
with raises(NotImplementedError):
self.partitioner.set_uuid(100, 'ID')
def test_create(self):
with raises(NotImplementedError):
self.partitioner.create('name', 100, 'type', ['flag'])
def test_set_flag(self):
with raises(NotImplementedError):
self.partitioner.set_flag(1, 'flag')
def test_set_hybrid_mbr(self):
with raises(NotImplementedError):
self.partitioner.set_hybrid_mbr()
def test_set_mbr(self):
with raises(NotImplementedError):
self.partitioner.set_mbr()
def test_resize_table(self):
with raises(NotImplementedError):
self.partitioner.resize_table()
def test_set_start_sector(self):
assert self.partitioner.set_start_sector(4096) is None