def testWriteLines(self):
    with BZ2File(self.filename, 'w') as bz2f:
        self.assertRaises(TypeError, bz2f.writelines)
        bz2f.writelines(self.TEXT_LINES)
    self.assertRaises(ValueError, bz2f.writelines, ['a'])
    with open(self.filename, 'rb') as f:
        self.assertEqual(ext_decompress(f.read()), self.TEXT)
def testWriteLines(self):
    with BZ2File(self.filename, 'w') as bz2f:
        self.assertRaises(TypeError, bz2f.writelines)
        bz2f.writelines(self.TEXT_LINES)
    self.assertRaises(ValueError, bz2f.writelines, ['a'])
    with open(self.filename, 'rb') as f:
        self.assertEqual(ext_decompress(f.read()), self.TEXT)