Ejemplo n.º 1
0
    def test_release(self):
        self.mock_lock.acquired = True
        lock = locking.ToozLock(self.mock_lock)

        lock.release()

        self.mock_lock.release.assert_called_once_with()
Ejemplo n.º 2
0
    def test_context(self):
        lock = locking.ToozLock(self.mock_lock)

        with lock:
            self.mock_lock.acquire.assert_called_once_with()

        self.mock_lock.release.assert_called_once_with()
Ejemplo n.º 3
0
 def test_acquire(self):
     lock = locking.ToozLock(self.mock_lock)
     lock.acquire()
     self.mock_lock.acquire.assert_called_once_with(blocking=True)