def test_lock(self): queue = WishboneQueue() queue.put("test") queue.lock() try: queue.put("test") except QueueLocked: pass else: raise AssertionError("Queue lock() not having desired effect.") try: queue.get() except QueueLocked: pass else: raise AssertionError("Queue lock not having desired effect.") assert queue.isLocked() == (True, True)
def test_isLocked(self): queue = WishboneQueue() queue.getLock() assert queue.isLocked() == (True, False)