summaryrefslogtreecommitdiff
path: root/tests/test_lock.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_lock.py')
-rw-r--r--tests/test_lock.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_lock.py b/tests/test_lock.py
index 8b2cc5b..efa9184 100644
--- a/tests/test_lock.py
+++ b/tests/test_lock.py
@@ -149,6 +149,14 @@ class TestLock(object):
assert 16000 < r.pttl('foo') <= 20000
lock.release()
+ def test_extend_lock_replace_ttl(self, r):
+ lock = self.get_lock(r, 'foo', timeout=10)
+ assert lock.acquire(blocking=False)
+ assert 8000 < r.pttl('foo') <= 10000
+ assert lock.extend(10, replace_ttl=True)
+ assert 8000 < r.pttl('foo') <= 10000
+ lock.release()
+
def test_extend_lock_float(self, r):
lock = self.get_lock(r, 'foo', timeout=10.0)
assert lock.acquire(blocking=False)