def METHOD_NAME(self):
    lock = defer.DeferredLock()
    @util.deferredLocked(lock)
    def check_locked(arg1, arg2):
        self.assertEqual([lock.locked, arg1, arg2], [True, 1, 2])
        return defer.succeed(None)
    yield check_locked(1, 2)
    self.assertFalse(lock.locked)