def METHOD_NAME(self, mode):
    tempdir = os.path.join(self.base_dir, "tempdir")
    os.mkdir(tempdir)
    util.write_file("", tempdir, "tempfile")
    os.chmod(tempdir, mode)
    util.rmtree(self.base_dir)
    self.assertFalse(os.path.exists(self.base_dir), "Failed to remove directory")