MCPcopy
hub / github.com/redis/redis-py / test_lock

Method test_lock

tests/test_lock.py:40–46  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

38 return redis.lock(*args, **kwargs)
39
40 def test_lock(self, r):
41 lock = self.get_lock(r, "foo")
42 assert lock.acquire(blocking=False)
43 assert r.get("foo") == lock.local.token
44 assert r.ttl("foo") == -1
45 lock.release()
46 assert r.get("foo") is None
47
48 def test_lock_token(self, r):
49 lock = self.get_lock(r, "foo")

Callers

nothing calls this directly

Calls 5

get_lockMethod · 0.95
acquireMethod · 0.45
getMethod · 0.45
ttlMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected