Esempio n. 1
0
File: image.py Progetto: r00ta/conu
    def get_volume_options(volumes):
        """
        Generates volume options to run methods.

        :param volumes: tuple or list of tuples in form target x source,target x source,target,mode.
        :return: list of the form ["-v", "/source:/target", "-v", "/other/source:/destination:z", ...]
        """
        if not isinstance(volumes, list):
            volumes = [volumes]
        volumes = [Volume.create_from_tuple(v) for v in volumes]
        result = []
        for v in volumes:
            result += ["-v", str(v)]
        return result
Esempio n. 2
0
def test_volume_create_from_tuple(input_parameter, result):
    assert str(Volume.create_from_tuple(input_parameter)) == result