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

Method testPeek

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

Source from the content-addressed store, hash-verified

180 self.assertEqual(bz2f.read(100), self.TEXT[:100])
181
182 def testPeek(self):
183 self.createTempFile()
184 with BZ2File(self.filename) as bz2f:
185 pdata = bz2f.peek()
186 self.assertNotEqual(len(pdata), 0)
187 self.assertStartsWith(self.TEXT, pdata)
188 self.assertEqual(bz2f.read(), self.TEXT)
189
190 def testReadInto(self):
191 self.createTempFile()

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected