How to use the aioredlock.Lock.valid function in aioredlock

To help you get started, we’ve selected a few aioredlock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joanvila / aioredlock / tests / ut / test_algorithm.py View on Github external
async def test_is_locked(self, lock_manager_redis_patched, locked_lock, by_resource, locked):
        lock_manager, redis = lock_manager_redis_patched
        redis.is_locked.return_value = locked

        Lock.valid = locked
        resource = locked_lock.resource
        resource_or_lock = resource if by_resource else locked_lock

        res = await lock_manager.is_locked(resource_or_lock)

        assert res == locked
        redis.is_locked.assert_called_once_with(resource)

aioredlock

Asyncio implemetation of Redis distributed locks

MIT
Latest version published 2 years ago

Package Health Score

60 / 100
Full package analysis

Similar packages