Skip to content

Commit 864203f

Browse files
authored
Add cwl_utils.parser.latest (#119)
1 parent d10954e commit 864203f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

cwl_utils/parser/latest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .cwl_v1_2 import * # noqa: F403

tests/test_parser.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from ruamel import yaml
55

66
from cwl_utils.parser import cwl_version, load_document, load_document_by_uri, save
7+
import cwl_utils.parser.latest as latest
78

89
HERE = Path(__file__).resolve().parent
910
TEST_v1_0_CWL = HERE / "../testdata/md5sum.cwl"
@@ -59,3 +60,12 @@ def test_save() -> None:
5960
saved_obj = save([cwl_obj10, cwl_obj12])
6061
ver = cwl_version(saved_obj)
6162
assert ver == "v1.2"
63+
64+
65+
def test_latest_parser() -> None:
66+
"""Test the `latest` parser is same as cwl_v1_2 (current latest) parser."""
67+
uri = Path(TEST_v1_2_CWL).as_uri()
68+
with open(TEST_v1_2_CWL, "r") as cwl_h:
69+
yaml_obj12 = yaml.main.round_trip_load(cwl_h, preserve_quotes=True)
70+
latest_cwl_obj = latest.load_document_by_yaml(yaml_obj12, uri) # type: ignore
71+
assert latest_cwl_obj.cwlVersion == "v1.2"

0 commit comments

Comments
 (0)