File: init_test.py

package info (click to toggle)
kiwi 10.2.41-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 7,592 kB
  • sloc: python: 69,585; sh: 4,230; xml: 3,386; ansic: 391; makefile: 360
file content (22 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from unittest.mock import (
    patch, Mock
)
from pytest import raises

from kiwi.exceptions import KiwiBootLoaderInstallSetupError
from kiwi.bootloader.install import BootLoaderInstall


class TestBootLoaderInstall:
    def test_bootloader_install_not_implemented(self):
        with raises(KiwiBootLoaderInstallSetupError):
            BootLoaderInstall.new('foo', Mock(), 'root_dir', Mock())

    @patch('kiwi.bootloader.install.grub2.BootLoaderInstallGrub2')
    def test_bootloader_install_grub2(self, mock_grub2):
        device_provider = Mock()
        xml_state = Mock()
        BootLoaderInstall.new('grub2', xml_state, 'root_dir', device_provider)
        mock_grub2.assert_called_once_with(
            xml_state, 'root_dir', device_provider, None
        )