kiwi-el8/test/unit/filesystem_ext4_test.py
Thomas Schraitle 45bc5a03a7 Refactor into subpackage to fix #23
Codecoverage are 100% and tests are green

Changes:
* Refactor archive_*.py -> archive subpackage
* Refactor partitioner_*.py -> partitioner subpackage
* Refactor package_manager_*.py -> package_manager/ subpackage
* Refactor bootloader_config*.py -> bootloader/config/ subpackage
* Refactor bootloader_template*.py -> bootloader/template/ subpackage
* Refactor bootloader_install*.py -> bootloader/install/ subpackage
* Refactor repository*.py -> repository/ subpackage
* Refactor filesystem*.py -> filesystem/ subpackage
* Refactor dist_*.py -> dist/dformat subpackage
  The name `dformat` as package name is needed to avoid any name
  conflicts with the built-in function `format`.
* Refactor volume_manager*.py -> volume_manager/ subpackage
* Refactor boot_image*.py -> boot/image/ subpackage
2016-02-27 10:31:31 +01:00

31 lines
882 B
Python

from nose.tools import *
from mock import patch
import mock
from . import nose_helper
from kiwi.exceptions import *
from kiwi.filesystem.ext4 import FileSystemExt4
class TestFileSystemExt4(object):
@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.ext4 = FileSystemExt4(provider, 'root_dir')
self.ext4.setup_mountpoint = mock.Mock(
return_value='some-mount-point'
)
@patch('kiwi.filesystem.ext4.Command.run')
def test_create_on_device(self, mock_command):
self.ext4.create_on_device('label')
call = mock_command.call_args_list[0]
assert mock_command.call_args_list[0] == \
call(['mkfs.ext4', '-L', 'label', '/dev/foo'])