view env/lib/python3.9/site-packages/cwltool/tests/test_procgenerator.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
line wrap: on
line source

import os

from cwltool.main import main

from .util import get_data, windows_needs_docker


@windows_needs_docker
def test_missing_enable_ext() -> None:
    # Requires --enable-ext and --enable-dev
    try:
        opt = os.environ.get("CWLTOOL_OPTIONS")

        if "CWLTOOL_OPTIONS" in os.environ:
            del os.environ["CWLTOOL_OPTIONS"]
        assert main([get_data("tests/wf/generator/zing.cwl"), "--zing", "zipper"]) == 1

        assert (
            main(
                [
                    "--enable-ext",
                    "--enable-dev",
                    get_data("tests/wf/generator/zing.cwl"),
                    "--zing",
                    "zipper",
                ]
            )
            == 0
        )

        os.environ["CWLTOOL_OPTIONS"] = "--enable-ext --enable-dev"
        assert main([get_data("tests/wf/generator/zing.cwl"), "--zing", "zipper"]) == 0
    finally:
        if opt is not None:
            os.environ["CWLTOOL_OPTIONS"] = opt
        elif "CWLTOOL_OPTIONS" in os.environ:
            del os.environ["CWLTOOL_OPTIONS"]