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

Method testPeek

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

Source from the content-addressed store, hash-verified

190 self.assertEqual(bz2f.read(100), self.TEXT[:100])
191
192 def testPeek(self):
193 self.createTempFile()
194 with BZ2File(self.filename) as bz2f:
195 pdata = bz2f.peek()
196 self.assertNotEqual(len(pdata), 0)
197 self.assertStartsWith(self.TEXT, pdata)
198 self.assertEqual(bz2f.read(), self.TEXT)
199
200 def testReadInto(self):
201 self.createTempFile()

Callers

nothing calls this directly

Calls 7

createTempFileMethod · 0.95
BZ2FileClass · 0.90
assertNotEqualMethod · 0.80
assertStartsWithMethod · 0.80
peekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected