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

Method testReadInto

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

Source from the content-addressed store, hash-verified

188 self.assertEqual(bz2f.read(), self.TEXT)
189
190 def testReadInto(self):
191 self.createTempFile()
192 with BZ2File(self.filename) as bz2f:
193 n = 128
194 b = bytearray(n)
195 self.assertEqual(bz2f.readinto(b), n)
196 self.assertEqual(b, self.TEXT[:n])
197 n = len(self.TEXT) - n
198 b = bytearray(len(self.TEXT))
199 self.assertEqual(bz2f.readinto(b), n)
200 self.assertEqual(b[:n], self.TEXT[-n:])
201
202 def testReadLine(self):
203 self.createTempFile()

Callers

nothing calls this directly

Calls 5

createTempFileMethod · 0.95
BZ2FileClass · 0.90
lenFunction · 0.85
assertEqualMethod · 0.45
readintoMethod · 0.45

Tested by

no test coverage detected