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
24 lines
649 B
Python
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
|
|
)
|