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.
24 lines
742 B
Python
24 lines
742 B
Python
from mock import patch
|
|
|
|
from .test_helper import raises
|
|
|
|
from kiwi.exceptions import KiwiContainerImageSetupError
|
|
|
|
from kiwi.container import ContainerImage
|
|
|
|
|
|
class TestContainerImage(object):
|
|
@raises(KiwiContainerImageSetupError)
|
|
def test_container_image_not_implemented(self):
|
|
ContainerImage('foo', 'root_dir')
|
|
|
|
@patch('kiwi.container.ContainerImageDocker')
|
|
def test_container_image_docker(self, mock_docker):
|
|
ContainerImage('docker', 'root_dir')
|
|
mock_docker.assert_called_once_with('root_dir', None)
|
|
|
|
@patch('kiwi.container.ContainerImageOCI')
|
|
def test_container_image_oci(self, mock_oci):
|
|
ContainerImage('oci', 'root_dir')
|
|
mock_oci.assert_called_once_with('root_dir', None)
|