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

Method test_peek

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected