def testPeekBytesIO(self):
    with BytesIO(self.DATA) as bio:
        with BZ2File(bio) as bz2f:
            pdata = bz2f.peek()
            self.assertNotEqual(len(pdata), 0)
            self.assertTrue(self.TEXT.startswith(pdata))
            self.assertEqual(bz2f.read(), self.TEXT)
def testPeekBytesIO(self):
    with BytesIO(self.DATA) as bio:
        with BZ2File(bio) as bz2f:
            pdata = bz2f.peek()
            self.assertNotEqual(len(pdata), 0)
            self.assertTrue(self.TEXT.startswith(pdata))
            self.assertEqual(bz2f.read(), self.TEXT)