File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,10 @@ def test_outputBinding(cwl_v1_2_schema: SchemaType) -> None:
67
67
68
68
def test_yaml_tab_error (cwl_v1_2_schema : SchemaType ) -> None :
69
69
"""Tabs in the file."""
70
+ res : Any = ""
70
71
with pytest .raises (
71
72
ValidationException ,
72
73
match = r".+found\s+character\s+'\\t'\s+that\s+cannot\s+start\s+any\s+token$" ,
73
74
):
74
75
res = load_cwl (cwl_v1_2_schema , src = "test_real_cwl/tabs_rna_seq_workflow.cwl" )
75
- print (res )
76
+ print (res )
Original file line number Diff line number Diff line change @@ -132,12 +132,12 @@ def test_error_message5() -> None:
132
132
133
133
t = "test_schema/test5.cwl"
134
134
match = r"""
135
- ^.+test5\.cwl:2:1: Object\s+'.+test5\.cwl'\s+is\s+not valid because
136
- \s+tried 'Workflow'\s+but
137
- .+test5\.cwl:7:1: the 'steps'\s+field\s+is\s+not\s+valid\s+because
138
- \s+tried array\s+of\s+<WorkflowStep>\s+but
139
- .+test5\.cwl:7:9: item is\s+invalid\s+because
140
- \s+is not a\s+dict$""" [
135
+ ^.+test5\.cwl:2:1: Object\s+'.+test5\.cwl'\s+is\s+not\s+ valid\s+ because
136
+ \s+tried\s+ 'Workflow'\s+but
137
+ .+test5\.cwl:7:1: the\s+ 'steps'\s+field\s+is\s+not\s+valid\s+because
138
+ \s+tried\s+ array\s+of\s+<WorkflowStep>\s+but
139
+ .+test5\.cwl:7:9: item\s+ is\s+invalid\s+because
140
+ \s+is\s+ not\s+ a\s+dict.\s+Expected\s+a\s+WorkflowStep\s+object. $""" [
141
141
1 :
142
142
]
143
143
with pytest .raises (ValidationException , match = match ):
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ def validate_ex(
196
196
raise ValidationException (
197
197
"the value {} is not a valid {}, expected {}{}" .format (
198
198
vpformat (datum ),
199
- expected_schema .name ,
199
+ friendly ( expected_schema .name ) ,
200
200
"one of " if len (expected_schema .symbols ) > 1 else "" ,
201
201
"'" + "', '" .join (expected_schema .symbols ) + "'" ,
202
202
)
@@ -299,7 +299,9 @@ def validate_ex(
299
299
if isinstance (expected_schema , avro .schema .RecordSchema ):
300
300
if not isinstance (datum , MutableMapping ):
301
301
if raise_ex :
302
- raise ValidationException ("is not a dict" )
302
+ raise ValidationException (
303
+ f"is not a dict. Expected a { friendly (expected_schema .name )} object."
304
+ )
303
305
return False
304
306
305
307
classmatch = None
You can’t perform that action at this time.
0 commit comments