Beispiel #1
0
def test_msgpack(everything: Everything):
    converter = msgpack_make_converter()
    raw = msgpack_dumps(converter.unstructure(everything))
    assert (converter.structure(
        msgpack_loads(raw, strict_map_key=False),
        Everything,
    ) == everything)
Beispiel #2
0
def test_msgpack(everything: Everything):
    from msgpack import dumps as msgpack_dumps
    from msgpack import loads as msgpack_loads

    converter = msgpack_make_converter()
    raw = msgpack_dumps(converter.unstructure(everything))
    assert (converter.structure(msgpack_loads(raw, strict_map_key=False),
                                Everything) == everything)
Beispiel #3
0
 def delete(self, tree_path, *args, **kwargs):
     super(MsgpackWriterMixin,
           self).delete([msgpack_dumps(i) for i in tree_path], *args,
                        **kwargs)
Beispiel #4
0
 def update(self, tree_path, value, *args, **kwargs):
     super(MsgpackWriterMixin,
           self).update([msgpack_dumps(i) for i in tree_path],
                        msgpack_dumps(value), *args, **kwargs)
Beispiel #5
0
 def dumps(cls, data: Any) -> bytes:
     return msgpack_dumps(data,
                          default=cls._encode,
                          use_bin_type=True,
                          strict_types=True)