def test_compress_begin_update_end(self): context = lz4frame.create_compression_context() self.assertNotEqual(context, None) input_data = b"2099023098234882923049823094823094898239230982349081231290381209380981203981209381238901283098908123109238098123" chunk_size = int((len(input_data)/2)+1) compressed = lz4frame.compress_begin(context) compressed += lz4frame.compress_update(context, input_data[:chunk_size]) compressed += lz4frame.compress_update(context, input_data[chunk_size:]) compressed += lz4frame.compress_end(context) lz4frame.free_compression_context(context) decompressed = lz4frame.decompress(compressed,1024) self.assertEqual(input_data, decompressed)
def test_create_and_free_compression_context(self): context = lz4frame.create_compression_context() self.assertNotEqual(context, None) lz4frame.free_compression_context(context)