示例#1
0
 def test_redefined_args(self):
     runtime_context = RuntimeContext()
     runtime_context.use_container = False
     runtime_context.on_error = "continue"
     f = cwltool.factory.Factory(runtime_context=runtime_context)
     assert f.runtime_context.use_container is False
     assert f.runtime_context.on_error == "continue"
示例#2
0
 def test_redefined_args(self):
     runtime_context = RuntimeContext()
     runtime_context.use_container = False
     runtime_context.on_error = "continue"
     f = cwltool.factory.Factory(runtime_context=runtime_context)
     assert f.runtime_context.use_container is False
     assert f.runtime_context.on_error == "continue"
示例#3
0
def test_factory_redefined_args() -> None:
    runtime_context = RuntimeContext()
    runtime_context.use_container = False
    runtime_context.on_error = "continue"
    factory = cwltool.factory.Factory(runtime_context=runtime_context)

    assert factory.runtime_context.use_container is False
    assert factory.runtime_context.on_error == "continue"
示例#4
0
def test_compute_checksum():
    runtime_context = RuntimeContext()
    runtime_context.compute_checksum = True
    runtime_context.use_container = onWindows()
    factory = cwltool.factory.Factory(runtime_context=runtime_context)
    echo = factory.make(get_data("tests/wf/cat-tool.cwl"))
    output = echo(
        file1={"class": "File",
               "location": get_data("tests/wf/whale.txt")},
        reverse=False)
    assert output['output']["checksum"] == "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376"
示例#5
0
 def test_compute_checksum(self):
     runtime_context = RuntimeContext()
     runtime_context.compute_checksum = True
     runtime_context.use_container = onWindows()
     f = cwltool.factory.Factory(runtime_context=runtime_context)
     echo = f.make(get_data("tests/wf/cat-tool.cwl"))
     output = echo(
         file1={"class": "File",
                "location": get_data("tests/wf/whale.txt")},
         reverse=False)
     self.assertEquals(output['output']["checksum"], "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376")
示例#6
0
文件: util.py 项目: ltirrell/cwltool
def get_windows_safe_factory(runtime_context=None,  # type: RuntimeContext
                             loading_context=None,  # type: LoadingContext
                             executor=None          # type: Any
                            ):  # type: (...) -> Factory
    if onWindows():
        if not runtime_context:
            runtime_context = RuntimeContext()
        runtime_context.find_default_container = functools.partial(
            force_default_container, windows_default_container_id)
        runtime_context.use_container = True
        runtime_context.default_container = windows_default_container_id
    return Factory(executor, loading_context, runtime_context)
示例#7
0
def get_windows_safe_factory(runtime_context=None,  # type: RuntimeContext
                             loading_context=None,  # type: LoadingContext
                             executor=None          # type: Any
                            ):  # type: (...) -> Factory
    if onWindows():
        if not runtime_context:
            runtime_context = RuntimeContext()
        runtime_context.find_default_container = functools.partial(
            force_default_container, windows_default_container_id)
        runtime_context.use_container = True
        runtime_context.default_container = windows_default_container_id
    return Factory(executor, loading_context, runtime_context)
示例#8
0
def test_compute_checksum() -> None:
    runtime_context = RuntimeContext()
    runtime_context.compute_checksum = True
    runtime_context.use_container = onWindows()
    factory = cwltool.factory.Factory(runtime_context=runtime_context)
    echo = factory.make(get_data("tests/wf/cat-tool.cwl"))
    output = echo(
        file1={"class": "File", "location": get_data("tests/wf/whale.txt")},
        reverse=False,
    )
    assert isinstance(output, dict)
    result = output["output"]
    assert isinstance(result, dict)
    assert result["checksum"] == "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376"