Ejemplo n.º 1
0
 def testLockUnlock(self):
     lockable.lock(self.lock.lockable)
     self.assertTrue(self.lock.lockable.locked)
     self.assertRaises(lockable.LockedError, lockable.open, self.lock.lockable)
     lockable.unlock(self.lock.lockable)
     self.assertFalse(self.lock.lockable.locked)
     lockable.open(self.lock.lockable)
     self.assertRaises(lockable.OpenError, lockable.lock, self.lock.lockable)
Ejemplo n.º 2
0
 def execute(self):
     """Open the box."""
     lockable.unlock(self.lockable.lockable)
     Action.execute(self)