kiwi-el8/test/unit/oci_tools_base_test.py
David Cassany 8f1048f840
Refactor OCI images packing
This commit refactors the OCI images support:

  * added import_container_image and export_container_image methods
    to oci_tools classes. 'umoci' and 'buildah' consume different
    formats thus the inital skopeo call to import a container is tool
    dependent.

  * use oci-archive transport for packing the OCI images, this causes
    docker and oci operations to just diverge on transport type.

  * add_tag method no longer needed in oci_tools/base, skopeo is used
    for that matter.

  * container/docker.py class is no longer needed. The difference
    between docker and OCI images is just on packing format which is just
    a parameter in skopeo. It does not deserve a dedicated class

  * system/root_import/docker.py class no longer needed. The difference
    between OCI and Docker class was just the transport type for the
    skopeo call. It does not deserve a dedicated class
2019-03-11 13:54:42 +01:00

47 lines
1.3 KiB
Python

from pytest import raises
from kiwi.oci_tools.base import OCIBase
class TestOCIBase(object):
def setup(self):
self.oci = OCIBase()
def test_init_container(self):
with raises(NotImplementedError):
self.oci.init_container()
def test_import_container_image(self):
with raises(NotImplementedError):
self.oci.import_container_image('oci-archive:image.xz')
def test_export_container_image(self):
with raises(NotImplementedError):
self.oci.export_container_image(
'image.xz', 'docker-archive', 'myimage:tag'
)
def test_unpack(self):
with raises(NotImplementedError):
self.oci.unpack()
def test_sync_rootfs(self):
with raises(NotImplementedError):
self.oci.sync_rootfs('root_dir')
def test_import_rootfs(self):
with raises(NotImplementedError):
self.oci.import_rootfs('root_dir')
def test_repack(self):
with raises(NotImplementedError):
self.oci.repack({})
def test_set_config(self):
with raises(NotImplementedError):
self.oci.set_config({})
def test_post_process(self):
with raises(NotImplementedError):
self.oci.post_process()