Пример #1
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        unlock_lock(lockable)
        EntityAction.execute(self)
Пример #2
0
 def testLockUnlock(self):
     lockable.lock_lock(self.lock.lockable)
     self.assertTrue(self.lock.lockable.locked)
     self.assertRaises(lockable.LockedError, lockable.open_lock,
                       self.lock.lockable)
     lockable.unlock_lock(self.lock.lockable)
     self.assertFalse(self.lock.lockable.locked)
     lockable.open_lock(self.lock.lockable)
     self.assertRaises(lockable.OpenError, lockable.lock_lock,
                       self.lock.lockable)
Пример #3
0
 def testLockUnlock(self):
     lockable.lock_lock(self.lock.lockable)
     self.assertTrue(self.lock.lockable.locked)
     self.assertRaises(lockable.LockedError, lockable.open_lock,
                       self.lock.lockable)
     lockable.unlock_lock(self.lock.lockable)
     self.assertFalse(self.lock.lockable.locked)
     lockable.open_lock(self.lock.lockable)
     self.assertRaises(lockable.OpenError, lockable.lock_lock,
                       self.lock.lockable)
Пример #4
0
    def execute(self):
        """Execute the action

        Raises:
            :class:`fife_rpg.exceptions.NoSuchCommandError`
            if a command is detected that is not registered.
        """
        lockable = getattr(self.target, Lockable.registered_as)
        unlock_lock(lockable)
        EntityAction.execute(self)