示例#1
0
    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)
示例#2
0
 def test_isLocked(self):
     queue = WishboneQueue()
     queue.getLock()
     assert queue.isLocked() == (True, False)