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

Method test_peek

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

Source from the content-addressed store, hash-verified

2028 self.assertEqual(ba, DECOMPRESSED_100_PLUS_32KB[400:700])
2029
2030 def test_peek(self):
2031 with ZstdFile(io.BytesIO(DAT_130K_C)) as f:
2032 result = f.peek()
2033 self.assertGreater(len(result), 0)
2034 self.assertTrue(DAT_130K_D.startswith(result))
2035 self.assertEqual(f.read(), DAT_130K_D)
2036 with ZstdFile(io.BytesIO(DAT_130K_C)) as f:
2037 result = f.peek(10)
2038 self.assertGreater(len(result), 0)
2039 self.assertTrue(DAT_130K_D.startswith(result))
2040 self.assertEqual(f.read(), DAT_130K_D)
2041
2042 def test_peek_bad_args(self):
2043 with ZstdFile(io.BytesIO(), "w") as f:

Callers

nothing calls this directly

Calls 7

ZstdFileClass · 0.90
assertGreaterMethod · 0.80
assertTrueMethod · 0.80
peekMethod · 0.45
startswithMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected