(self)
| 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) |
nothing calls this directly
no test coverage detected