def METHOD_NAME(self, mockGetcwd, mockExists):
    mockExists.return_value = True  # will not create a file
    mockGetcwd.return_value = "/tornado/document/root"  # so we have a path defined (will overwrite it below)
    plugin = FileCacheLoggingPlugin()
    vo = "anyVO"
    with tempfile.TemporaryDirectory(suffix="pilottests") as d:
        plugin.meta["LogPath"] = d
        payload = '{"retCode": 0}'
        logfile = "78f39a90-2073-11ec-98d7-b496913c0cf4"  # == pilotUUID
        os.mkdir(os.path.join(d, vo))  # vo specific directory, normally created by sending the first message
        # will fail here...
        res = plugin.finaliseLogs(payload, logfile, vo)
        self.assertFalse(res["OK"])
        # create a file ..
        with open(os.path.join(d, vo, logfile), "w") as f:
            f.write("Create a dummy logfile")
        res = plugin.finaliseLogs(payload, logfile, vo)
        self.assertTrue(res["OK"])
        logfile = "invalid!"
        res = plugin.finaliseLogs(payload, logfile, vo)
        self.assertFalse(res["OK"])