@@ -1685,3 +1685,59 @@ def test_command_line_tool_class() -> None:
16851685 tool_path = get_data ("tests/echo.cwl" )
16861686 expression_tool = factory .make (tool_path ).t
16871687 assert str (expression_tool ) == f"CommandLineTool: file://{ tool_path } "
1688+
1689+
1690+ def test_record_default_with_long () -> None :
1691+ """Confirm that record defaults are respected."""
1692+ tool_path = get_data ("tests/wf/paramref_arguments_roundtrip.cwl" )
1693+ err_code , stdout , stderr = get_main_output ([tool_path ])
1694+ assert err_code == 0
1695+ result = json .loads (stdout )["same_record" ]
1696+ assert result ["first" ] == "y"
1697+ assert result ["second" ] == 23
1698+ assert result ["third" ] == 2.3
1699+ assert result ["fourth" ] == 4242424242
1700+ assert result ["fifth" ] == 4200000000000000000000000000000000000000000
1701+ assert result ["sixth" ]["class" ] == "File"
1702+ assert result ["sixth" ]["basename" ] == "whale.txt"
1703+ assert result ["sixth" ]["size" ] == 1111
1704+ assert (
1705+ result ["sixth" ]["checksum" ] == "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376"
1706+ )
1707+
1708+
1709+ def test_record_outputeval () -> None :
1710+ """Confirm that record types can be populated from outputEval."""
1711+ tool_path = get_data ("tests/wf/record_outputeval.cwl" )
1712+ err_code , stdout , stderr = get_main_output ([tool_path ])
1713+ assert err_code == 0
1714+ result = json .loads (stdout )["references" ]
1715+ assert "genome_fa" in result
1716+ assert result ["genome_fa" ]["class" ] == "File"
1717+ assert result ["genome_fa" ]["basename" ] == "GRCm38.primary_assembly.genome.fa"
1718+ assert (
1719+ result ["genome_fa" ]["checksum" ]
1720+ == "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709"
1721+ )
1722+ assert result ["genome_fa" ]["size" ] == 0
1723+ assert "annotation_gtf" in result
1724+ assert result ["annotation_gtf" ]["class" ] == "File"
1725+ assert (
1726+ result ["annotation_gtf" ]["basename" ]
1727+ == "gencode.vM21.primary_assembly.annotation.gtf"
1728+ )
1729+ assert (
1730+ result ["annotation_gtf" ]["checksum" ]
1731+ == "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709"
1732+ )
1733+ assert result ["annotation_gtf" ]["size" ] == 0
1734+
1735+
1736+ def tests_outputsource_valid_identifier_invalid_source () -> None :
1737+ """Confirm error for invalid source that was also a valid identifier."""
1738+ tool_path = get_data ("tests/checker_wf/broken-wf4.cwl" )
1739+ err_code , stdout , stderr = get_main_output ([tool_path ])
1740+ assert err_code == 1
1741+ stderr = re .sub (r"\s\s+" , " " , stderr )
1742+ assert "tests/checker_wf/broken-wf4.cwl:12:5: outputSource not found" in stderr
1743+ assert "tests/checker_wf/broken-wf4.cwl#echo_w" in stderr
0 commit comments