def METHOD_NAME(self):
    path = os.path.join(self.tmpdir, "foo.bz2")
    f = cr.CrFile(path, cr.MODE_WRITE, cr.BZ2_COMPRESSION)
    self.assertTrue(f)
    self.assertTrue(os.path.isfile(path))
    f.write("foobar")
    f.close()
    import bz2
    with open(path, 'rb') as foo_bz2:
        content = bz2.decompress(foo_bz2.read()).decode('utf-8')
        self.assertEqual(content, "foobar")