Пример #1
0
    def test_unlock(self):
        queue = WishboneQueue()
        queue.lock()

        try:
            queue.put("test")
        except QueueLocked:
            queue.unlock()
            try:
                queue.put("test")
            except QueueLocked:
                raise AssertionError("Queue unlock() does not seem to have the desired effect.")
            else:
                pass
        else:
            raise AssertionError ("Queue lock() does not seem to have the desired effect.")
Пример #2
0
 def test_rescue(self):
     queue = WishboneQueue()
     queue.lock()
     queue.rescue("test")
     queue.unlock()
     assert queue.get() == "test"