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