| 1 |
from unittest.mock import ( |
| 2 |
patch, Mock |
| 3 |
) |
| 4 |
from pytest import raises |
| 5 |
|
| 6 |
from kiwi.exceptions import KiwiBootLoaderInstallSetupError |
| 7 |
from kiwi.bootloader.install import BootLoaderInstall |
| 8 |
|
| 9 |
|
| 10 |
class TestBootLoaderInstall: |
| 11 |
def test_bootloader_install_not_implemented(self): |
| 12 |
with raises(KiwiBootLoaderInstallSetupError): |
| 13 |
BootLoaderInstall.new('foo', Mock(), 'root_dir', Mock()) |
| 14 |
|
| 15 |
@patch('kiwi.bootloader.install.grub2.BootLoaderInstallGrub2') |
| 16 |
def test_bootloader_install_grub2(self, mock_grub2): |
| 17 |
device_provider = Mock() |
| 18 |
xml_state = Mock() |
| 19 |
BootLoaderInstall.new('grub2', xml_state, 'root_dir', device_provider) |
| 20 |
mock_grub2.assert_called_once_with( |
| 21 |
xml_state, 'root_dir', device_provider, None |
| 22 |
) |