comparison contrib/python-zstandard/tests/test_module_attributes.py @ 43994:de7838053207

zstandard: vendor python-zstandard 0.13.0 Version 0.13.0 of the package was just released. It contains an upgraded zstd C library which can result in some performance wins, official support for Python 3.8, and a blackened code base. There were no meaningful code or functionality changes in this release of python-zstandard: just reformatting and an upgraded zstd library version. So the diff seems much larger than what it is. Files were added without modifications. The clang-format-ignorelist file was updated to reflect a new header file in the zstd distribution. # no-check-commit because 3rd party code has different style guidelines Differential Revision: https://phab.mercurial-scm.org/D7770
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 28 Dec 2019 09:55:45 -0800
parents 69de49c4e39c
children 6000f5b25c9b
comparison
equal deleted inserted replaced
43993:873d0fecb9a3 43994:de7838053207
2 2
3 import unittest 3 import unittest
4 4
5 import zstandard as zstd 5 import zstandard as zstd
6 6
7 from . common import ( 7 from .common import (
8 make_cffi, 8 make_cffi,
9 TestCase,
9 ) 10 )
10 11
11 12
12 @make_cffi 13 @make_cffi
13 class TestModuleAttributes(unittest.TestCase): 14 class TestModuleAttributes(TestCase):
14 def test_version(self): 15 def test_version(self):
15 self.assertEqual(zstd.ZSTD_VERSION, (1, 4, 3)) 16 self.assertEqual(zstd.ZSTD_VERSION, (1, 4, 4))
16 17
17 self.assertEqual(zstd.__version__, '0.12.0') 18 self.assertEqual(zstd.__version__, "0.13.0")
18 19
19 def test_constants(self): 20 def test_constants(self):
20 self.assertEqual(zstd.MAX_COMPRESSION_LEVEL, 22) 21 self.assertEqual(zstd.MAX_COMPRESSION_LEVEL, 22)
21 self.assertEqual(zstd.FRAME_HEADER, b'\x28\xb5\x2f\xfd') 22 self.assertEqual(zstd.FRAME_HEADER, b"\x28\xb5\x2f\xfd")
22 23
23 def test_hasattr(self): 24 def test_hasattr(self):
24 attrs = ( 25 attrs = (
25 'CONTENTSIZE_UNKNOWN', 26 "CONTENTSIZE_UNKNOWN",
26 'CONTENTSIZE_ERROR', 27 "CONTENTSIZE_ERROR",
27 'COMPRESSION_RECOMMENDED_INPUT_SIZE', 28 "COMPRESSION_RECOMMENDED_INPUT_SIZE",
28 'COMPRESSION_RECOMMENDED_OUTPUT_SIZE', 29 "COMPRESSION_RECOMMENDED_OUTPUT_SIZE",
29 'DECOMPRESSION_RECOMMENDED_INPUT_SIZE', 30 "DECOMPRESSION_RECOMMENDED_INPUT_SIZE",
30 'DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE', 31 "DECOMPRESSION_RECOMMENDED_OUTPUT_SIZE",
31 'MAGIC_NUMBER', 32 "MAGIC_NUMBER",
32 'FLUSH_BLOCK', 33 "FLUSH_BLOCK",
33 'FLUSH_FRAME', 34 "FLUSH_FRAME",
34 'BLOCKSIZELOG_MAX', 35 "BLOCKSIZELOG_MAX",
35 'BLOCKSIZE_MAX', 36 "BLOCKSIZE_MAX",
36 'WINDOWLOG_MIN', 37 "WINDOWLOG_MIN",
37 'WINDOWLOG_MAX', 38 "WINDOWLOG_MAX",
38 'CHAINLOG_MIN', 39 "CHAINLOG_MIN",
39 'CHAINLOG_MAX', 40 "CHAINLOG_MAX",
40 'HASHLOG_MIN', 41 "HASHLOG_MIN",
41 'HASHLOG_MAX', 42 "HASHLOG_MAX",
42 'HASHLOG3_MAX', 43 "HASHLOG3_MAX",
43 'MINMATCH_MIN', 44 "MINMATCH_MIN",
44 'MINMATCH_MAX', 45 "MINMATCH_MAX",
45 'SEARCHLOG_MIN', 46 "SEARCHLOG_MIN",
46 'SEARCHLOG_MAX', 47 "SEARCHLOG_MAX",
47 'SEARCHLENGTH_MIN', 48 "SEARCHLENGTH_MIN",
48 'SEARCHLENGTH_MAX', 49 "SEARCHLENGTH_MAX",
49 'TARGETLENGTH_MIN', 50 "TARGETLENGTH_MIN",
50 'TARGETLENGTH_MAX', 51 "TARGETLENGTH_MAX",
51 'LDM_MINMATCH_MIN', 52 "LDM_MINMATCH_MIN",
52 'LDM_MINMATCH_MAX', 53 "LDM_MINMATCH_MAX",
53 'LDM_BUCKETSIZELOG_MAX', 54 "LDM_BUCKETSIZELOG_MAX",
54 'STRATEGY_FAST', 55 "STRATEGY_FAST",
55 'STRATEGY_DFAST', 56 "STRATEGY_DFAST",
56 'STRATEGY_GREEDY', 57 "STRATEGY_GREEDY",
57 'STRATEGY_LAZY', 58 "STRATEGY_LAZY",
58 'STRATEGY_LAZY2', 59 "STRATEGY_LAZY2",
59 'STRATEGY_BTLAZY2', 60 "STRATEGY_BTLAZY2",
60 'STRATEGY_BTOPT', 61 "STRATEGY_BTOPT",
61 'STRATEGY_BTULTRA', 62 "STRATEGY_BTULTRA",
62 'STRATEGY_BTULTRA2', 63 "STRATEGY_BTULTRA2",
63 'DICT_TYPE_AUTO', 64 "DICT_TYPE_AUTO",
64 'DICT_TYPE_RAWCONTENT', 65 "DICT_TYPE_RAWCONTENT",
65 'DICT_TYPE_FULLDICT', 66 "DICT_TYPE_FULLDICT",
66 ) 67 )
67 68
68 for a in attrs: 69 for a in attrs:
69 self.assertTrue(hasattr(zstd, a), a) 70 self.assertTrue(hasattr(zstd, a), a)