| 1 |
from unittest.mock import ( |
| 2 |
patch, Mock |
| 3 |
) |
| 4 |
from pytest import raises |
| 5 |
|
| 6 |
from kiwi.snapshot_manager import SnapshotManager |
| 7 |
|
| 8 |
from kiwi.exceptions import KiwiSnapshotManagerSetupError |
| 9 |
|
| 10 |
|
| 11 |
class TestSnapshotManager: |
| 12 |
def test_snapshot_manager_not_implemented(self): |
| 13 |
with raises(KiwiSnapshotManagerSetupError): |
| 14 |
SnapshotManager.new( |
| 15 |
'foo', '/dev/device', 'root_dir', 'mountpoint', '@', [Mock()] |
| 16 |
) |
| 17 |
|
| 18 |
@patch('kiwi.snapshot_manager.snapper.SnapshotManagerSnapper') |
| 19 |
def test_snapshot_manager_snapper(self, mock_snapper): |
| 20 |
SnapshotManager.new( |
| 21 |
'snapper', '/dev/device', 'root_dir', 'mountpoint', '@', None |
| 22 |
) |
| 23 |
mock_snapper.assert_called_once_with( |
| 24 |
'/dev/device', 'root_dir', 'mountpoint', '@', None |
| 25 |
) |