def METHOD_NAME(self):
    if os.path.exists(self._tmp_dir):
        # Allow deletion
        for endpoint in self.endpoints:
            path = os.path.join(self._tmp_dir, endpoint)
            os.chmod(path, 0o660)
        # Allow write in directory again for cleanup
        os.chmod(self._tmp_dir, 0o755)
        shutil.rmtree(self._tmp_dir)