comparison env/lib/python3.9/site-packages/cwltool/tests/test_anon_types.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 from typing import cast
2
3 import pytest
4 from ruamel.yaml.comments import CommentedMap
5 from schema_salad.sourceline import cmap
6
7 from cwltool.command_line_tool import CommandLineTool
8 from cwltool.context import LoadingContext
9
10 snippet = cast(
11 CommentedMap,
12 cmap(
13 [
14 {
15 "cwlVersion": "v1.0",
16 "class": "CommandLineTool",
17 "inputs": [
18 {
19 "type": {
20 "type": "record",
21 "fields": [
22 {
23 "type": [
24 {
25 "type": "enum",
26 "symbols": [
27 "anon_enum_inside_array.cwl#first/species/homo_sapiens",
28 "anon_enum_inside_array.cwl#first/species/mus_musculus",
29 ],
30 },
31 "null",
32 ],
33 "name": "anon_enum_inside_array.cwl#first/species",
34 }
35 ],
36 },
37 "id": "anon_enum_inside_array.cwl#first",
38 },
39 {
40 "type": [
41 "null",
42 {
43 "type": "enum",
44 "symbols": [
45 "anon_enum_inside_array.cwl#second/homo_sapiens",
46 "anon_enum_inside_array.cwl#second/mus_musculus",
47 ],
48 },
49 ],
50 "id": "anon_enum_inside_array.cwl#second",
51 },
52 ],
53 "baseCommand": "echo",
54 "outputs": [],
55 "id": "anon_enum_inside_array.cwl",
56 },
57 {
58 "cwlVersion": "v1.0",
59 "class": "CommandLineTool",
60 "requirements": [
61 {
62 "types": [
63 {
64 "name": "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params",
65 "type": "record",
66 "fields": [
67 {
68 "type": [
69 "null",
70 {
71 "type": "enum",
72 "symbols": [
73 "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/ncbi_build/GRCh37",
74 "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/ncbi_build/GRCh38",
75 "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/ncbi_build/GRCm38",
76 ],
77 },
78 ],
79 "name": "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/ncbi_build",
80 },
81 {
82 "type": [
83 "null",
84 {
85 "type": "enum",
86 "symbols": [
87 "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/species/homo_sapiens",
88 "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/species/mus_musculus",
89 ],
90 },
91 ],
92 "name": "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params/species",
93 },
94 ],
95 }
96 ],
97 "class": "SchemaDefRequirement",
98 }
99 ],
100 "inputs": [
101 {
102 "type": "anon_enum_inside_array_inside_schemadef.cwl#vcf2maf_params",
103 "id": "anon_enum_inside_array_inside_schemadef.cwl#first",
104 }
105 ],
106 "baseCommand": "echo",
107 "outputs": [],
108 "id": "anon_enum_inside_array_inside_schemadef.cwl",
109 },
110 ]
111 ),
112 )
113
114
115 @pytest.mark.parametrize("snippet", snippet)
116 def test_anon_types(snippet: CommentedMap) -> None:
117 CommandLineTool(snippet, LoadingContext())