MCPcopy Index your code
hub / github.com/python/cpython / test_get_frame_info

Method test_get_frame_info

Lib/test/test_zstd.py:162–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 self.assertEqual(dat2, raw_dat)
161
162 def test_get_frame_info(self):
163 # no dict
164 info = get_frame_info(COMPRESSED_100_PLUS_32KB[:20])
165 self.assertEqual(info.decompressed_size, 32 * _1K + 100)
166 self.assertEqual(info.dictionary_id, 0)
167
168 # use dict
169 dat = compress(b"a" * 345, zstd_dict=TRAINED_DICT)
170 info = get_frame_info(dat)
171 self.assertEqual(info.decompressed_size, 345)
172 self.assertEqual(info.dictionary_id, TRAINED_DICT.dict_id)
173
174 with self.assertRaisesRegex(ZstdError, "not less than the frame header"):
175 get_frame_info(b"aaaaaaaaaaaaaa")
176
177 def test_get_frame_size(self):
178 size = get_frame_size(COMPRESSED_100_PLUS_32KB)

Callers

nothing calls this directly

Calls 4

get_frame_infoFunction · 0.90
compressFunction · 0.90
assertRaisesRegexMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected