contrib/python-zstandard/tests/test_estimate_sizes.py
author Yuya Nishihara <yuya@tcha.org>
Tue, 06 Mar 2018 07:45:57 -0600
changeset 36837 472c68cda3f8
parent 30895 c32454d69b85
child 37495 b1fb341d8a61
permissions -rw-r--r--
py3: wrap file object to write patch in native eol preserving byte-ness

try:
    import unittest2 as unittest
except ImportError:
    import unittest

import zstd

from . common import (
    make_cffi,
)


@make_cffi
class TestSizes(unittest.TestCase):
    def test_decompression_size(self):
        size = zstd.estimate_decompression_context_size()
        self.assertGreater(size, 100000)

    def test_compression_size(self):
        params = zstd.get_compression_parameters(3)
        size = zstd.estimate_compression_context_size(params)
        self.assertGreater(size, 100000)