|
1 | 1 | from cwltool.load_tool import load_tool
|
2 | 2 | from cwltool.context import LoadingContext, RuntimeContext
|
3 | 3 | from cwltool.errors import WorkflowException
|
| 4 | +from cwltool.update import INTERNAL_VERSION |
4 | 5 | import pytest
|
5 | 6 | from .util import (get_data, get_main_output,
|
6 | 7 | get_windows_safe_factory,
|
@@ -60,3 +61,21 @@ def test_checklink_outputSource():
|
60 | 61 | loadingContext = LoadingContext({"do_validate": False})
|
61 | 62 | tool = load_tool(get_data("tests/wf/1st-workflow.cwl"), loadingContext)
|
62 | 63 | assert norm(tool.tool["outputs"][0]["outputSource"]) == outsrc
|
| 64 | + |
| 65 | +def test_load_graph_fragment(): |
| 66 | + """Test that outputSource is resolved correctly independent of value |
| 67 | + of do_validate. |
| 68 | +
|
| 69 | + """ |
| 70 | + |
| 71 | + loadingContext = LoadingContext() |
| 72 | + uri = Path(get_data("tests/wf/scatter-wf4.cwl")).as_uri()+"#main" |
| 73 | + tool = load_tool(uri, loadingContext) |
| 74 | + |
| 75 | + rs, metadata = tool.doc_loader.resolve_ref(uri) |
| 76 | + # Reload from a dict (in 'rs'), not a URI. The dict is a fragment |
| 77 | + # of original document and doesn't have cwlVersion set, so test |
| 78 | + # that it correctly looks up the root document to get the |
| 79 | + # cwlVersion. |
| 80 | + tool = load_tool(tool.tool, loadingContext) |
| 81 | + assert tool.metadata["cwlVersion"] == INTERNAL_VERSION |
0 commit comments