'If the lock is initially held but then released before it can be
examined to determine if the process which held it still exists, it is
acquired and the C{clean} and C{locked} attributes are set to C{True}.'

def test_lockReleasedBeforeCheck(self):

    def fakeReadlink(name):
        lockfile.rmlink(lockf)
        readlinkPatch.restore()
        return lockfile.readlink(name)
    readlinkPatch = self.patch(lockfile, 'readlink', fakeReadlink)
    def fakeKill(pid, signal):
        if (signal != 0):
            raise OSError(errno.EPERM, None)
        if (pid == 43125):
            raise OSError(errno.ESRCH, None)
    self.patch(lockfile, 'kill', fakeKill)
    lockf = self.mktemp()
    lock = lockfile.FilesystemLock(lockf)
    lockfile.symlink(str(43125), lockf)
    self.assertTrue(lock.lock())
    self.assertTrue(lock.clean)
    self.assertTrue(lock.locked)
