'An exception raised by L{rmlink} other than C{ENOENT} is passed up
to the caller of L{FilesystemLock.lock}.'

def test_rmlinkError(self):

    def fakeRmlink(name):
        raise OSError(errno.ENOSYS, None)
    self.patch(lockfile, 'rmlink', fakeRmlink)
    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()
    lockfile.symlink(str(43125), lockf)
    lock = lockfile.FilesystemLock(lockf)
    exc = self.assertRaises(OSError, lock.lock)
    self.assertEqual(exc.errno, errno.ENOSYS)
    self.assertFalse(lock.locked)
