kiwi-el8/test/unit/filesystem/fat32_test.py
David Cassany 4b3a105026
Re-structure unit tests folders
This commit relocates unit tests to a folder structure that matches
the source code structure.

Fixes #1128
2019-10-21 14:00:05 +02:00

27 lines
812 B
Python

from mock import patch
import mock
from kiwi.filesystem.fat32 import FileSystemFat32
class TestFileSystemFat32:
@patch('os.path.exists')
def setup(self, mock_exists):
mock_exists.return_value = True
provider = mock.Mock()
provider.get_device = mock.Mock(
return_value='/dev/foo'
)
self.fat32 = FileSystemFat32(provider, 'root_dir')
self.fat32.setup_mountpoint = mock.Mock(
return_value='some-mount-point'
)
@patch('kiwi.filesystem.fat32.Command.run')
def test_create_on_device(self, mock_command):
self.fat32.create_on_device('label')
call = mock_command.call_args_list[0]
assert mock_command.call_args_list[0] == \
call(['mkdosfs', '-F32', '-I', '-n', 'label', '/dev/foo'])