kiwi-el8/test/unit/utils_sync_test.py
Marcus Schäfer e246e72a52
Refactor data subpackage
Move from data to utils, data is generally considered
as text data and not code
2016-03-17 10:42:08 +01:00

28 lines
694 B
Python

from mock import patch
import mock
from .test_helper import *
from kiwi.exceptions import *
from kiwi.utils.sync import DataSync
class TestDataSync(object):
def setup(self):
self.sync = DataSync('source_dir', 'target_dir')
@patch('kiwi.utils.sync.Command.run')
def test_sync_data(self, mock_command):
self.sync.sync_data(
options=['-a', '-H', '-X', '-A', '--one-file-system'],
exclude=['exclude_me']
)
mock_command.assert_called_once_with(
[
'rsync', '-a', '-H', '-X', '-A', '--one-file-system',
'--exclude', '/exclude_me', 'source_dir', 'target_dir'
]
)