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))