def test_compress_decompress(compress_scheme): if compress_scheme == LZ4: syft.serde._apply_compress_scheme = apply_lz4_compression elif compress_scheme == ZSTD: syft.serde._apply_compress_scheme = apply_zstd_compression else: syft.serde._apply_compress_scheme = apply_no_compression original = msgpack.dumps([1, 2, 3]) compressed = _compress(original) decompressed = _decompress(compressed) assert type(compressed) == bytes assert original == decompressed
def test_compress_decompress(compress_scheme): original = msgpack.dumps([1, 2, 3]) compressed = _compress(original, compress_scheme=compress_scheme) decompressed = _decompress(compressed, compress_scheme=compress_scheme) assert type(compressed) == bytes assert original == decompressed