##// END OF EJS Templates
bundle2: keep hint close to the primary message when remote abort...
bundle2: keep hint close to the primary message when remote abort The remote hint message was ignored when reporting the remote error and passed to the local generic abort error. I think I might initially have tried to avoid reimplementing logic controlling the hint display depending of the verbosity level. However, first, there does not seems to have such verbosity related logic and second the resulting was wrong as the primary error and the hint were split apart. We now properly print the hint as remote output.

File last commit:

r30435:b86a448a default
r30908:4c8dcb49 stable
Show More
test_cffi.py
35 lines | 838 B | text/x-python | PythonLexer
import io
try:
import unittest2 as unittest
except ImportError:
import unittest
import zstd
try:
import zstd_cffi
except ImportError:
raise unittest.SkipTest('cffi version of zstd not available')
class TestCFFIWriteToToCDecompressor(unittest.TestCase):
def test_simple(self):
orig = io.BytesIO()
orig.write(b'foo')
orig.write(b'bar')
orig.write(b'foobar' * 16384)
dest = io.BytesIO()
cctx = zstd_cffi.ZstdCompressor()
with cctx.write_to(dest) as compressor:
compressor.write(orig.getvalue())
uncompressed = io.BytesIO()
dctx = zstd.ZstdDecompressor()
with dctx.write_to(uncompressed) as decompressor:
decompressor.write(dest.getvalue())
self.assertEqual(uncompressed.getvalue(), orig.getvalue())