def test_context(self): lock = locking.InternalLock(self.node.uuid) lock._lock = self.mock_lock with lock: self.mock_lock.acquire.assert_called_once_with() self.mock_lock.release.assert_called_once_with()
def test_acquire(self): lock = locking.InternalLock(self.node.uuid) lock._lock = self.mock_lock lock.acquire() self.mock_lock.acquire.assert_called_once_with(blocking=True)
def test_init_lock(self, mock_lockutils): locking.InternalLock(self.node.uuid) mock_lockutils.internal_lock.assert_called_with( 'node-%s' % self.node.uuid, mock.ANY)