MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_get_frame_info

Method test_get_frame_info

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

Source from the content-addressed store, hash-verified

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