File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,27 @@ def test_array_valid(self, unmarshaller_factory):
352
352
353
353
assert result == value
354
354
355
+ def test_array_null (self , unmarshaller_factory ):
356
+ schema = Schema (
357
+ 'array' ,
358
+ items = Schema ('integer' ),
359
+ )
360
+ value = None
361
+
362
+ with pytest .raises (TypeError ):
363
+ unmarshaller_factory (schema )(value )
364
+
365
+ def test_array_nullable (self , unmarshaller_factory ):
366
+ schema = Schema (
367
+ 'array' ,
368
+ items = Schema ('integer' ),
369
+ nullable = True ,
370
+ )
371
+ value = None
372
+ result = unmarshaller_factory (schema )(value )
373
+
374
+ assert result is None
375
+
355
376
def test_array_of_string_string_invalid (self , unmarshaller_factory ):
356
377
schema = Schema ('array' , items = Schema ('string' ))
357
378
value = '123'
You can’t perform that action at this time.
0 commit comments