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

Method test_open_prefix

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

Source from the content-addressed store, hash-verified

2649 open(bi, 'w', zstd_dict=b'1234567890')
2650
2651 def test_open_prefix(self):
2652 bi = io.BytesIO()
2653 with open(bi, 'w', zstd_dict=TRAINED_DICT.as_prefix) as f:
2654 f.write(SAMPLES[0])
2655 bi.seek(0)
2656 with open(bi, zstd_dict=TRAINED_DICT.as_prefix) as f:
2657 dat = f.read()
2658 self.assertEqual(dat, SAMPLES[0])
2659
2660 def test_buffer_protocol(self):
2661 # don't use len() for buffer protocol objects

Callers

nothing calls this directly

Calls 5

seekMethod · 0.95
openFunction · 0.90
writeMethod · 0.45
readMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected