try:
    import unittest2 as unittest
except ImportError:
    import unittest

import zstd

class TestCompressionParameters(unittest.TestCase):
    def test_init_bad_arg_type(self):
        with self.assertRaises(TypeError):
            zstd.CompressionParameters()

        with self.assertRaises(TypeError):
            zstd.CompressionParameters((0, 1))

    def test_get_compression_parameters(self):
        p = zstd.get_compression_parameters(1)
        self.assertIsInstance(p, zstd.CompressionParameters)

        self.assertEqual(p[0], 19)

@@ -72,16 +72,133 @@
 ittest%0A%0A
+try:%0A    import hypothesis%0A    import hypothesis.strategies as strategies%0Aexcept ImportError:%0A    hypothesis = None%0A%0A
 import z
@@ -659,8 +659,2036 @@
 0%5D, 19)%0A
+%0Aif hypothesis:%0A    s_windowlog = strategies.integers(min_value=zstd.WINDOWLOG_MIN,%0A                                      max_value=zstd.WINDOWLOG_MAX)%0A    s_chainlog = strategies.integers(min_value=zstd.CHAINLOG_MIN,%0A                                     max_value=zstd.CHAINLOG_MAX)%0A    s_hashlog = strategies.integers(min_value=zstd.HASHLOG_MIN,%0A                                    max_value=zstd.HASHLOG_MAX)%0A    s_searchlog = strategies.integers(min_value=zstd.SEARCHLOG_MIN,%0A                                      max_value=zstd.SEARCHLOG_MAX)%0A    s_searchlength = strategies.integers(min_value=zstd.SEARCHLENGTH_MIN,%0A                                         max_value=zstd.SEARCHLENGTH_MAX)%0A    s_targetlength = strategies.integers(min_value=zstd.TARGETLENGTH_MIN,%0A                                         max_value=zstd.TARGETLENGTH_MAX)%0A    s_strategy = strategies.sampled_from((zstd.STRATEGY_FAST,%0A                                          zstd.STRATEGY_DFAST,%0A                                          zstd.STRATEGY_GREEDY,%0A                                          zstd.STRATEGY_LAZY,%0A                                          zstd.STRATEGY_LAZY2,%0A                                          zstd.STRATEGY_BTLAZY2,%0A                                          zstd.STRATEGY_BTOPT))%0A%0A    class TestCompressionParametersHypothesis(unittest.TestCase):%0A        @hypothesis.given(s_windowlog, s_chainlog, s_hashlog, s_searchlog,%0A                          s_searchlength, s_targetlength, s_strategy)%0A        def test_valid_init(self, windowlog, chainlog, hashlog, searchlog,%0A                            searchlength, targetlength, strategy):%0A            p = zstd.CompressionParameters(windowlog, chainlog, hashlog,%0A                                           searchlog, searchlength,%0A                                           targetlength, strategy)%0A            self.assertEqual(tuple(p),%0A                             (windowlog, chainlog, hashlog, searchlog,%0A                              searchlength, targetlength, strategy))%0A

Add hypothesis test to randomly generate CompressionParameters