Beispiel #1
0
 def test_acquire_same_lock_twice_blocking_without_timeout(self):
     assert not self.redis.exists(self.redlock.key)
     with ContextTimer() as timer:
         assert self.redlock.acquire()
         assert self.redis.exists(self.redlock.key)
         assert self.redlock.acquire()
         assert self.redis.exists(self.redlock.key)
         assert timer.elapsed() >= self.redlock.auto_release_time
Beispiel #2
0
 def setUp(self):
     super().setUp()
     self.timer = ContextTimer()