Exemplo n.º 1
0
    def test_dumps_new_type(self):
        raw_value = 'd1d61dd7-c036-47d3-a6ed-91cc2e885fc8'
        id_value = Id(UUID(raw_value))

        d_new_type = DataClassWithNewType(id_value)

        assert DataClassWithNewType.schema().dumps(d_new_type) == f'{{"id": "{raw_value}"}}'
Exemplo n.º 2
0
 def test_new_type_decode(self):
     assert (DataClassWithNewType.from_json(
         self.dc_new_type_json) == DataClassWithNewType(
             Id(UUID(self.new_type_s))))
Exemplo n.º 3
0
 def test_new_type_encode(self):
     assert (DataClassWithNewType(Id(UUID(
         self.new_type_s))).to_json() == self.dc_new_type_json)