69
69
70
70
Invalid bytes
71
71
[Template] Conversion Should Fail
72
- Bytes \u0100
72
+ Bytes \u0100 error=Character '\u0100' cannot be mapped to a byte.
73
+ Bytes \u00ff\u0100\u0101 error=Character '\u0100' cannot be mapped to a byte.
74
+ Bytes Hyvä esimerkki! \u2603 error=Character '\u2603' cannot be mapped to a byte.
73
75
74
76
Bytearray
75
77
Bytearray foo bytearray(b'foo')
@@ -80,7 +82,9 @@ Bytearray
80
82
81
83
Invalid bytearray
82
84
[Template] Conversion Should Fail
83
- Bytearray \u0100
85
+ Bytearray \u0100 error=Character '\u0100' cannot be mapped to a byte.
86
+ Bytearray \u00ff\u0100\u0101 error=Character '\u0100' cannot be mapped to a byte.
87
+ Bytearray Hyvä esimerkki! \u2603 error=Character '\u2603' cannot be mapped to a byte.
84
88
85
89
Datetime
86
90
DateTime 2014-06-11T10:07:42 datetime(2014, 6, 11, 10, 7, 42)
@@ -89,10 +93,10 @@ Datetime
89
93
90
94
Invalid datetime
91
95
[Template] Conversion Should Fail
92
- DateTime foobar
93
- DateTime 1975:06
94
- DateTime 2018
95
- DateTime 201808081443421234567
96
+ DateTime foobar error=Invalid timestamp 'foobar'.
97
+ DateTime 1975:06 error=Invalid timestamp '1975:06'.
98
+ DateTime 2018 error=Invalid timestamp '2018'.
99
+ DateTime 201808081443421234567 error=Invalid timestamp '201808081443421234567'.
96
100
97
101
Date
98
102
Date 2014-06-11 date(2014, 6, 11)
@@ -101,11 +105,11 @@ Date
101
105
102
106
Invalid date
103
107
[Template] Conversion Should Fail
104
- Date foobar
105
- Date 1975:06
106
- Date 2018
107
- Date 2014-06-11T10:07:42
108
- Date 20180808000000000001
108
+ Date foobar error=Invalid timestamp 'foobar'.
109
+ Date 1975:06 error=Invalid timestamp '1975:06'.
110
+ Date 2018 error=Invalid timestamp '2018'.
111
+ Date 2014-06-11T10:07:42 error=Value is datetime, not date.
112
+ Date 20180808000000000001 error=Value is datetime, not date.
109
113
110
114
Timedelta
111
115
Timedelta 10 timedelta(seconds=10)
@@ -121,18 +125,18 @@ Timedelta
121
125
122
126
Invalid timedelta
123
127
[Template] Conversion Should Fail
124
- Timedelta foobar
125
- Timedelta 1 foo
126
- Timedelta 01:02:03:04
127
-
128
+ Timedelta foobar error=Invalid time string 'foobar'.
129
+ Timedelta 1 foo error=Invalid time string '1 foo'.
130
+ Timedelta 01:02:03:04 error=Invalid time string '01:02:03:04'.
128
131
Enum
132
+
129
133
Enum FOO MyEnum.FOO
130
134
Enum bar MyEnum.bar
131
135
132
136
Invalid Enum
133
137
[Template] Conversion Should Fail
134
- Enum foobar type=MyEnum
135
- Enum BAR type=MyEnum
138
+ Enum foobar type=MyEnum error=MyEnum does not have member 'foobar'. Available: 'FOO' and 'bar'
139
+ Enum BAR type=MyEnum error=MyEnum does not have member 'BAR'. Available: 'FOO' and 'bar'
136
140
137
141
NoneType
138
142
NoneType None None
@@ -149,13 +153,13 @@ List
149
153
150
154
Invalid list
151
155
[Template] Conversion Should Fail
152
- List [1, ooops]
153
- List ()
154
- List {}
155
- List ooops
156
- List ${EMPTY }
157
- List !"#¤%&/(invalid expression)\=?
158
- List 1 / 0
156
+ List [1, ooops] error=Invalid expression.
157
+ List () error=Value is tuple, not list.
158
+ List {} error=Value is dictionary, not list.
159
+ List ooops error=Invalid expression.
160
+ List ${EMPTY } error=Invalid expression.
161
+ List !"#¤%&/(invalid expression)\=? error=Invalid expression.
162
+ List 1 / 0 error=Invalid expression.
159
163
160
164
Tuple
161
165
Tuple () ()
@@ -164,10 +168,10 @@ Tuple
164
168
165
169
Invalid tuple
166
170
[Template] Conversion Should Fail
167
- Tuple (1, ooops)
168
- Tuple []
169
- Tuple {}
170
- Tuple ooops
171
+ Tuple (1, ooops) error=Invalid expression.
172
+ Tuple [] error=Value is list, not tuple.
173
+ Tuple {} error=Value is dictionary, not tuple.
174
+ Tuple ooops error=Invalid expression.
171
175
172
176
Dictionary
173
177
Dictionary {} {}
@@ -176,11 +180,11 @@ Dictionary
176
180
177
181
Invalid dictionary
178
182
[Template] Conversion Should Fail
179
- Dictionary {1: ooops}
180
- Dictionary []
181
- Dictionary ()
182
- Dictionary ooops
183
- Dictionary {{'not': 'hashable'}: 'xxx'}
183
+ Dictionary {1: ooops} error=Invalid expression.
184
+ Dictionary [] error=Value is list, not dict.
185
+ Dictionary () error=Value is tuple, not dict.
186
+ Dictionary ooops error=Invalid expression.
187
+ Dictionary {{'not': 'hashable'}: 'xxx'} error=Evaluating expression failed: *
184
188
185
189
Set
186
190
Set set() set()
@@ -189,13 +193,13 @@ Set
189
193
190
194
Invalid set
191
195
[Template] Conversion Should Fail
192
- Set {1, ooops}
193
- Set {}
194
- Set ()
195
- Set []
196
- Set ooops
197
- Set {{'not', 'hashable'}}
198
- Set frozenset()
196
+ Set {1, ooops} error=Invalid expression.
197
+ Set {} error=Value is dictionary, not set.
198
+ Set () error=Value is tuple, not set.
199
+ Set [] error=Value is list, not set.
200
+ Set ooops error=Invalid expression.
201
+ Set {{'not', 'hashable'}} error=Evaluating expression failed: *
202
+ Set frozenset() error=Invalid expression.
199
203
200
204
Frozenset
201
205
Frozenset frozenset() frozenset()
@@ -205,10 +209,10 @@ Frozenset
205
209
206
210
Invalid frozenset
207
211
[Template] Conversion Should Fail
208
- Frozenset {1, ooops} type=set
209
- Frozenset {} type=set
210
- Frozenset ooops type=set
211
- Frozenset {{'not', 'hashable'}} type=set
212
+ Frozenset {1, ooops} type=set error=Invalid expression.
213
+ Frozenset {} type=set error=Value is dictionary, not set.
214
+ Frozenset ooops type=set error=Invalid expression.
215
+ Frozenset {{'not', 'hashable'}} type=set error=Evaluating expression failed: *
212
216
213
217
Iterable abc
214
218
Iterable ['list', 'is', 'ok'] ['list', 'is', 'ok']
@@ -218,17 +222,27 @@ Iterable abc
218
222
219
223
Invalid iterable abc
220
224
[Template] Conversion Should Fail
221
- Iterable foobar
225
+ Iterable foobar error=Failed to convert to list, tuple, set or dictionary.
226
+
227
+ Sequence abc
228
+ Sequence ['list', 'is', 'ok'] ['list', 'is', 'ok']
229
+ Sequence ('tuple',) ('tuple',)
230
+
231
+ Invalid sequence abc
232
+ [Template] Conversion Should Fail
233
+ Sequence foobar error=Failed to convert to list or tuple.
234
+ Sequence {'a': 1, 'b': 2} error=Failed to convert to list or tuple.
235
+ Sequence {1, 2, 3} error=Failed to convert to list or tuple.
222
236
223
237
Mapping abc
224
238
Mapping {'foo': 1, 2: 'bar'} {'foo': 1, 2: 'bar'}
225
239
Mutable mapping {'foo': 1, 2: 'bar'} {'foo': 1, 2: 'bar'}
226
240
227
241
Invalid mapping abc
228
242
[Template] Conversion Should Fail
229
- Mapping foobar type=dictionary
230
- Mapping [] type=dictionary
231
- Mutable mapping barfoo type=dictionary
243
+ Mapping foobar type=dictionary error=Invalid expression.
244
+ Mapping [] type=dictionary error=Value is list, not dict.
245
+ Mutable mapping barfoo type=dictionary error=Invalid expression.
232
246
233
247
Set abc
234
248
Set abc set() set()
@@ -240,12 +254,12 @@ Set abc
240
254
241
255
Invalid set abc
242
256
[Template] Conversion Should Fail
243
- Set abc {1, ooops} type=set
244
- Set abc {} type=set
245
- Set abc ooops type=set
246
- Mutable set {1, ooops} type=set
247
- Mutable set {} type=set
248
- Mutable set ooops type=set
257
+ Set abc {1, ooops} type=set error=Invalid expression.
258
+ Set abc {} type=set error=Value is dictionary, not set.
259
+ Set abc ooops type=set error=Invalid expression.
260
+ Mutable set {1, ooops} type=set error=Invalid expression.
261
+ Mutable set {} type=set error=Value is dictionary, not set.
262
+ Mutable set ooops type=set error=Invalid expression.
249
263
250
264
Unknown types are not converted
251
265
Unknown foo 'foo'
@@ -272,7 +286,7 @@ Invalid positional as named
272
286
[Template] Conversion Should Fail
273
287
Integer argument=1.0
274
288
Float argument=xxx
275
- Dictionary argument=[0]
289
+ Dictionary argument=[0] error=Value is list, not dict.
276
290
277
291
Varargs
278
292
Varargs 1 2 3 expected=(1, 2, 3)
0 commit comments