def testReadInto(self):
    self.createTempFile()
    with BZ2File(self.filename) as bz2f:
        n = 128
        b = bytearray(n)
        self.assertEqual(bz2f.readinto(b), n)
        self.assertEqual(b, self.TEXT[:n])
        n = (len(self.TEXT) - n)
        b = bytearray(len(self.TEXT))
        self.assertEqual(bz2f.readinto(b), n)
        self.assertEqual(b[:n], self.TEXT[(- n):])
def testReadInto(self):
    self.createTempFile()
    with BZ2File(self.filename) as bz2f:
        n = 128
        b = bytearray(n)
        self.assertEqual(bz2f.readinto(b), n)
        self.assertEqual(b, self.TEXT[:n])
        n = (len(self.TEXT) - n)
        b = bytearray(len(self.TEXT))
        self.assertEqual(bz2f.readinto(b), n)
        self.assertEqual(b[:n], self.TEXT[(- n):])