kiwi-el8/test/unit/container_setup_test.py
David Cassany c35f9f3b23 Add support for OCI images
This commit adds support for OCI images. Most of the docker related
code is reused for OCI classes and Docker classes have been refactored
so now they are a splecialization of the OCI classes. It is done this
way since KIWI internally only uses OCI format to operate with
containers, therefore docker images just differ from OCI images by
the way they are packaged or unpackaged.
2017-04-19 16:44:33 +02:00

24 lines
732 B
Python

from mock import patch
from .test_helper import raises
from kiwi.exceptions import KiwiContainerSetupError
from kiwi.container.setup import ContainerSetup
class TestContainerSetup(object):
@raises(KiwiContainerSetupError)
def test_container_not_implemented(self):
ContainerSetup('foo', 'root_dir')
@patch('kiwi.container.setup.ContainerSetupDocker')
def test_container_docker(self, mock_docker):
ContainerSetup('docker', 'root_dir')
mock_docker.assert_called_once_with('root_dir', None)
@patch('kiwi.container.setup.ContainerSetupOCI')
def test_container_oci(self, mock_oci):
ContainerSetup('oci', 'root_dir')
mock_oci.assert_called_once_with('root_dir', None)