示例#1
0
 def test_infer_missing_is_recursive(self):
     actual = DataClassWithOptionalNested.from_json('{"x": {}}',
                                                    infer_missing=True)
     expected = DataClassWithOptionalNested(DataClassWithOptional(None))
     assert (actual == expected)
示例#2
0
 def test_infer_missing_terminates_at_first_missing(self):
     actual = DataClassWithOptionalNested.from_json('{"x": null}',
                                                    infer_missing=True)
     assert (actual == DataClassWithOptionalNested(None))