(self)
| 2325 | self.assertRaises(ValueError, f.tell) |
| 2326 | |
| 2327 | def test_file_dict(self): |
| 2328 | # default |
| 2329 | bi = io.BytesIO() |
| 2330 | with ZstdFile(bi, 'w', zstd_dict=TRAINED_DICT) as f: |
| 2331 | f.write(SAMPLES[0]) |
| 2332 | bi.seek(0) |
| 2333 | with ZstdFile(bi, zstd_dict=TRAINED_DICT) as f: |
| 2334 | dat = f.read() |
| 2335 | self.assertEqual(dat, SAMPLES[0]) |
| 2336 | |
| 2337 | # .as_(un)digested_dict |
| 2338 | bi = io.BytesIO() |
| 2339 | with ZstdFile(bi, 'w', zstd_dict=TRAINED_DICT.as_digested_dict) as f: |
| 2340 | f.write(SAMPLES[0]) |
| 2341 | bi.seek(0) |
| 2342 | with ZstdFile(bi, zstd_dict=TRAINED_DICT.as_undigested_dict) as f: |
| 2343 | dat = f.read() |
| 2344 | self.assertEqual(dat, SAMPLES[0]) |
| 2345 | |
| 2346 | def test_file_prefix(self): |
| 2347 | bi = io.BytesIO() |
nothing calls this directly
no test coverage detected