kiwi-el8/test/unit/container_image_docker_test.py
Marcus Schäfer 40e6308aa9 Port application from python 2.7 to 3.4
For new applications like this kiwi version and its use cases
it is better to base it on a more recent python version
2016-02-17 22:38:38 +01:00

27 lines
775 B
Python

from nose.tools import *
from mock import patch
import mock
from . import nose_helper
from kiwi.exceptions import *
from kiwi.container_image_docker import ContainerImageDocker
class TestContainerImageDocker(object):
def setup(self):
self.docker = ContainerImageDocker('root_dir')
@patch('kiwi.container_image_docker.ArchiveTar')
def test_create(self, mock_archive):
archive = mock.Mock()
mock_archive.return_value = archive
self.docker.create('result.tar.xz')
mock_archive.assert_called_once_with('result.tar')
archive.create_xz_compressed.assert_called_once_with(
exclude=[
'image', '.profile', '.kconfig', 'var/cache/kiwi', 'boot'
], source_dir='root_dir'
)