def test_isLocked(self):
        """
        L{isLocked} returns C{True} if the named lock is currently locked,
        C{False} otherwise.
        """
        lockf = self.mktemp()
        self.assertFalse(lockfile.isLocked(lockf))
        lock = lockfile.FilesystemLock(lockf)
        self.assertTrue(lock.lock())
        self.assertTrue(lockfile.isLocked(lockf))
        lock.unlock()
        self.assertFalse(lockfile.isLocked(lockf))

        L{isLocked} returns C{True} if the named lock is currently locked,
        C{False} otherwise.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_lockfile.py