def testSeekable(self):
    bz2f = BZ2File(BytesIO(self.DATA))
    try:
        self.assertTrue(bz2f.seekable())
        bz2f.read()
        self.assertTrue(bz2f.seekable())
    finally:
        bz2f.close()
    self.assertRaises(ValueError, bz2f.seekable)
    bz2f = BZ2File(BytesIO(), 'w')
    try:
        self.assertFalse(bz2f.seekable())
    finally:
        bz2f.close()
    self.assertRaises(ValueError, bz2f.seekable)
    src = BytesIO(self.DATA)
    src.seekable = (lambda : False)
    bz2f = BZ2File(src)
    try:
        self.assertFalse(bz2f.seekable())
    finally:
        bz2f.close()
    self.assertRaises(ValueError, bz2f.seekable)
def testSeekable(self):
    bz2f = BZ2File(BytesIO(self.DATA))
    try:
        self.assertTrue(bz2f.seekable())
        bz2f.read()
        self.assertTrue(bz2f.seekable())
    finally:
        bz2f.close()
    self.assertRaises(ValueError, bz2f.seekable)
    bz2f = BZ2File(BytesIO(), 'w')
    try:
        self.assertFalse(bz2f.seekable())
    finally:
        bz2f.close()
    self.assertRaises(ValueError, bz2f.seekable)
    src = BytesIO(self.DATA)
    src.seekable = (lambda : False)
    bz2f = BZ2File(src)
    try:
        self.assertFalse(bz2f.seekable())
    finally:
        bz2f.close()
    self.assertRaises(ValueError, bz2f.seekable)