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

Method test_open_prefix

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

Source from the content-addressed store, hash-verified

2648 open(bi, 'w', zstd_dict=b'1234567890')
2649
2650 def test_open_prefix(self):
2651 bi = io.BytesIO()
2652 with open(bi, 'w', zstd_dict=TRAINED_DICT.as_prefix) as f:
2653 f.write(SAMPLES[0])
2654 bi.seek(0)
2655 with open(bi, zstd_dict=TRAINED_DICT.as_prefix) as f:
2656 dat = f.read()
2657 self.assertEqual(dat, SAMPLES[0])
2658
2659 def test_buffer_protocol(self):
2660 # 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