File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -496,3 +496,22 @@ def resolve_overrides(
496496def load_overrides (ov : str , base_url : str ) -> List [CWLObjectType ]:
497497 ovloader = Loader (overrides_ctx )
498498 return resolve_overrides (ovloader .fetch (ov ), ov , base_url )
499+
500+
501+ def recursive_resolve_and_validate_document (
502+ loadingContext : LoadingContext ,
503+ workflowobj : Union [CommentedMap , CommentedSeq ],
504+ uri : str ,
505+ preprocess_only : bool = False ,
506+ skip_schemas : Optional [bool ] = None ,
507+ ) -> Tuple [LoadingContext , str , Process ]:
508+ """Validate a CWL document, checking that a tool object can be built."""
509+ loadingContext , uri = resolve_and_validate_document (
510+ loadingContext ,
511+ workflowobj ,
512+ uri ,
513+ preprocess_only = preprocess_only ,
514+ skip_schemas = skip_schemas ,
515+ )
516+ tool = make_tool (uri , loadingContext )
517+ return loadingContext , uri , tool
Original file line number Diff line number Diff line change 1+ """Test the recursive validation feature (validate document and try to build tool)."""
2+ from cwltool .load_tool import fetch_document , recursive_resolve_and_validate_document
3+
4+ from .util import get_data
5+
6+
7+ def test_recursive_validation () -> None :
8+ """Test the recursive_resolve_and_validate_document function."""
9+ loadingContext , workflowobj , uri = fetch_document (
10+ get_data ("tests/wf/default_path.cwl" )
11+ )
12+ loadingContext , uri , tool = recursive_resolve_and_validate_document (
13+ loadingContext , workflowobj , uri
14+ )
You can’t perform that action at this time.
0 commit comments