kiwi-el8/test/unit/container_image_docker_test.py
Marcus Schäfer e6cc5bfa09 Move from nose to pytest
nose is no longer maintained, thus we have to move to another
testing system. This commit updates the tox setup and all tests
to use pytest instead of nose.
2016-03-14 12:23:14 +01:00

27 lines
740 B
Python

from mock import patch
import mock
from .test_helper import *
from kiwi.exceptions import *
from kiwi.container.docker import ContainerImageDocker
class TestContainerImageDocker(object):
def setup(self):
self.docker = ContainerImageDocker('root_dir')
@patch('kiwi.container.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'
)