示例#1
0
def test_valid_volume_mount():
    # create temp directory
    temp_dir = tempfile.mkdtemp()

    try:
        # test string that mounts local directory with mount path
        volume_mount = temp_dir + ":/mount_path"
        check_volume_mount(volume_mount)

        # test string that mounts local directory with mount path and specifies read only
        volume_mount = temp_dir + ":/mount_path:ro"
        check_volume_mount(volume_mount)
    finally:
        os.rmdir(temp_dir)
示例#2
0
def test_bad_volume_mount_strings(volume_mount_str):
    with pytest.raises(ArgumentTypeError):
        check_volume_mount(volume_mount_str)