kiwi-el8/test/unit/internal_boot_image_task_test.py
Marcus Schäfer a7fb5649f5 Refactor internal boot image task
Make a factory out of the task and allow to have e.g
a dracut boot image task at a later point in time.
The BootImageBase class creates an interface for this
implementation. So far only BootImageKiwi is implemented
2016-02-11 11:19:57 +01:00

24 lines
649 B
Python

from nose.tools import *
from mock import patch
import mock
import nose_helper
from kiwi.exceptions import *
from kiwi.internal_boot_image_task import BootImageTask
class TestInternalBootImageTask(object):
@raises(KiwiBootImageSetupError)
def test_boot_image_task_not_implemented(self):
BootImageTask('foo', mock.Mock(), 'target_dir')
@patch('kiwi.internal_boot_image_task.BootImageKiwi')
def test_boot_image_task_kiwi(self, mock_kiwi):
xml_state = mock.Mock()
BootImageTask('kiwi', xml_state, 'target_dir')
mock_kiwi.assert_called_once_with(
xml_state, 'target_dir', None
)