def test_master_lock_init_from_lockid(self): lock = RealMasterLock('lock1') lock.updateFromLockId(MasterLock('lock1', maxCount=3), 0) self.assertEqual(lock.lockName, 'lock1') self.assertEqual(lock.maxCount, 3) self.assertEqual(lock.description, '<MasterLock(lock1, 3)>')
def test_master_lock_update_from_lockid(self): lockid = MasterLock('lock1', maxCount=3) lock = RealMasterLock(lockid) lockid = MasterLock('lock1', maxCount=4) lock.updateFromLockId(lockid) self.assertEqual(lock.name, 'lock1') self.assertEqual(lock.maxCount, 4) self.assertEqual(lock.description, '<MasterLock(lock1, 4)>') with self.assertRaises(AssertionError): lockid = MasterLock('lock2', maxCount=4) lock.updateFromLockId(lockid)
def test_master_lock_init_from_lockid(self): lockid = MasterLock('lock1', maxCount=3) lock = RealMasterLock(lockid) self.assertEqual(lock.name, 'lock1') self.assertEqual(lock.maxCount, 3) self.assertEqual(lock.description, '<MasterLock(lock1, 3)>')
def test_master_lock_update_from_lockid(self): lock = RealMasterLock('lock1') lock.updateFromLockId(MasterLock('lock1', maxCount=3), 0) lock.updateFromLockId(MasterLock('lock1', maxCount=4), 0) self.assertEqual(lock.lockName, 'lock1') self.assertEqual(lock.maxCount, 4) self.assertEqual(lock.description, '<MasterLock(lock1, 4)>') with self.assertRaises(AssertionError): lock.updateFromLockId(MasterLock('lock2', maxCount=4), 0)