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

Method test_extend_lock

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

Source from the content-addressed store, hash-verified

208 assert lock.local.token is None
209
210 def test_extend_lock(self, r):
211 lock = self.get_lock(r, "foo", timeout=10)
212 assert lock.acquire(blocking=False)
213 assert 8000 < r.pttl("foo") <= 10000
214 assert lock.extend(10)
215 assert 16000 < r.pttl("foo") <= 20000
216 lock.release()
217
218 def test_extend_lock_replace_ttl(self, r):
219 lock = self.get_lock(r, "foo", timeout=10)

Callers

nothing calls this directly

Calls 5

get_lockMethod · 0.95
pttlMethod · 0.80
acquireMethod · 0.45
extendMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected