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

Method testPeekBytesIO

Lib/test/test_bz2.py:776–782  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

774 self.assertFalse(bio.closed)
775
776 def testPeekBytesIO(self):
777 with BytesIO(self.DATA) as bio:
778 with BZ2File(bio) as bz2f:
779 pdata = bz2f.peek()
780 self.assertNotEqual(len(pdata), 0)
781 self.assertStartsWith(self.TEXT, pdata)
782 self.assertEqual(bz2f.read(), self.TEXT)
783
784 def testWriteBytesIO(self):
785 with BytesIO() as bio:

Callers

nothing calls this directly

Calls 7

BytesIOClass · 0.90
BZ2FileClass · 0.90
assertNotEqualMethod · 0.80
assertStartsWithMethod · 0.80
peekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected