def testCompress(self):
    bz2c = BZ2Compressor()
    self.assertRaises(TypeError, bz2c.compress)
    data = bz2c.compress(self.TEXT)
    data += bz2c.flush()
    self.assertEqual(ext_decompress(data), self.TEXT)
def testCompress(self):
    bz2c = BZ2Compressor()
    self.assertRaises(TypeError, bz2c.compress)
    data = bz2c.compress(self.TEXT)
    data += bz2c.flush()
    self.assertEqual(ext_decompress(data), self.TEXT)