kiwi-el8/test/unit/bootloader_install_test.py
Marcus Schäfer 40e6308aa9 Port application from python 2.7 to 3.4
For new applications like this kiwi version and its use cases
it is better to base it on a more recent python version
2016-02-17 22:38:38 +01:00

28 lines
974 B
Python

from nose.tools import *
from mock import patch
import mock
from . import nose_helper
from kiwi.exceptions import *
from kiwi.bootloader_install import BootLoaderInstall
class TestBootLoaderInstall(object):
@raises(KiwiBootLoaderInstallSetupError)
def test_bootloader_install_not_implemented(self):
BootLoaderInstall('foo', 'root_dir', mock.Mock())
@patch('kiwi.bootloader_install.BootLoaderInstallGrub2')
def test_bootloader_install_grub2(self, mock_grub2):
device_provider = mock.Mock()
BootLoaderInstall('grub2', 'root_dir', device_provider)
mock_grub2.assert_called_once_with('root_dir', device_provider, None)
@patch('kiwi.bootloader_install.BootLoaderInstallZipl')
def test_bootloader_install_zipl(self, mock_zipl):
device_provider = mock.Mock()
BootLoaderInstall('grub2_s390x_emu', 'root_dir', device_provider)
mock_zipl.assert_called_once_with('root_dir', device_provider, None)