Exemple #1
0
 def test_loads_default_many(self):
     assert (DataClassImmutableDefault.schema().loads('[{}]', many=True)
             == [DataClassImmutableDefault()])
Exemple #2
0
 def test_loads_default(self):
     assert (DataClassImmutableDefault.schema().loads('{}')
             == DataClassImmutableDefault())
 def test_immutable_default(self):
     assert DataClassImmutableDefault().to_json() == '{"x": 0}'
 def test_immutable_default(self):
     assert (DataClassImmutableDefault.from_json('{"x": 0}') ==
             DataClassImmutableDefault())
Exemple #5
0
 def test_immutable_default(self):
     assert (DataClassImmutableDefault.from_json('{"x": 0}')
             == DataClassImmutableDefault())
     assert (DataClassMutableDefaultList.from_json('{}', infer_missing=True)
             == DataClassMutableDefaultList())