Update LZ4FrameCompressor tests to use compress_begin()
@@ -245,7 +245,8 @@ class TestLZ4Frame(unittest.TestCase):
def test_LZ4FrameCompressor(self):
input_data = b"2099023098234882923049823094823094898239230982349081231290381209380981203981209381238901283098908123109238098123"
with lz4frame.LZ4FrameCompressor() as compressor:
- compressed = compressor.compress(input_data)
+ compressed = compressor.compress_begin()
+ compressed += compressor.compress(input_data)
compressed += compressor.flush()
decompressed = lz4frame.decompress(compressed)
self.assertEqual(input_data, decompressed)
@@ -253,10 +254,12 @@ class TestLZ4Frame(unittest.TestCase):
def test_LZ4FrameCompressor_reset(self):
input_data = b"2099023098234882923049823094823094898239230982349081231290381209380981203981209381238901283098908123109238098123"
with lz4frame.LZ4FrameCompressor() as compressor:
- compressed = compressor.compress(input_data)
+ compressed = compressor.compress_begin()
+ compressed += compressor.compress(input_data)
compressed += compressor.flush()
compressor.reset()
- compressed = compressor.compress(input_data)
+ compressed = compressor.compress_begin()
+ compressed += compressor.compress(input_data)
compressed += compressor.flush()
decompressed = lz4frame.decompress(compressed)
self.assertEqual(input_data, decompressed)
@@ -297,7 +300,8 @@ class TestLZ4FrameModern(unittest.TestCase):
input_data = b"2099023098234882923049823094823094898239230982349081231290381209380981203981209381238901283098908123109238098123"
with self.assertRaisesRegexp(RuntimeError, r'compress called after flush'):
with lz4frame.LZ4FrameCompressor() as compressor:
- compressed = compressor.compress(input_data)
+ compressed = compressor.compress_begin()
+ compressed += compressor.compress(input_data)
compressed += compressor.flush()
compressed = compressor.compress(input_data)
