Example #1
0
 def test_loads_infer_missing_nested(self):
     assert (DataClassWithOptionalNested.schema(infer_missing=True).loads(
         '[{}]', many=True) == [DataClassWithOptionalNested(None)])
Example #2
0
 def test_infer_missing_is_recursive(self):
     actual = DataClassWithOptionalNested.from_json('{"x": {}}',
                                                    infer_missing=True)
     expected = DataClassWithOptionalNested(DataClassWithOptional(None))
     assert (actual == expected)
Example #3
0
 def test_infer_missing_terminates_at_first_missing(self):
     actual = DataClassWithOptionalNested.from_json('{"x": null}',
                                                    infer_missing=True)
     assert (actual == DataClassWithOptionalNested(None))