def METHOD_NAME(self):
    # Already closed file
    path = os.path.join(self.tmpdir, "primary.xml.gz")
    f = cr.CrFile(path, cr.MODE_WRITE, cr.GZ_COMPRESSION)
    self.assertTrue(f)
    self.assertTrue(os.path.isfile(path))
    f.close()
    self.assertRaises(cr.CreaterepoCError, f.write, "foobar")
    f.close() # No error should be raised
    del(f)    # No error should be raised