def _test_compression_streaming(self): # test compressing with one byte at a time... # XXX: disabled as LZMA doesn't support streaming compression yet compress = pylzma.compressobj(eos=1) infile = BytesIO(self.plain) outfile = BytesIO() while 1: data = infile.read(1) if not data: break outfile.write(compress.compress(data, 1)) outfile.write(compress.flush()) check = pylzma.decompress(outfile.getvalue()) self.assertEqual(check, self.plain)
def _test_compression_streaming(self): # XXX: this doesn't work, yet # test compressing with one byte at a time... compress = pylzma.compressobj(eos=1) infile = StringIO(self.plain) outfile = StringIO() while 1: data = infile.read(1) if not data: break outfile.write(compress.compress(data, 1)) outfile.write(compress.flush()) check = pylzma.decompress(outfile.getvalue()) self.assertEqual(check, self.plain)