Skip to content

Commit

Permalink
lock tests: change lock.token to lock.local.token
Browse files Browse the repository at this point in the history
  • Loading branch information
chillipino committed Jun 6, 2014
1 parent a3d8aad commit a48c2d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_lock(self, redis, *args, **kwargs):
def test_lock(self, sr):
lock = self.get_lock(sr, 'foo')
assert lock.acquire(blocking=False)
assert sr.get('foo') == lock.token
assert sr.get('foo') == lock.local.token
assert sr.ttl('foo') == -1
lock.release()
assert sr.get('foo') is None
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_context_manager(self, sr):
# blocking_timeout prevents a deadlock if the lock can't be acquired
# for some reason
with self.get_lock(sr, 'foo', blocking_timeout=0.2) as lock:
assert sr.get('foo') == lock.token
assert sr.get('foo') == lock.local.token
assert sr.get('foo') is None

def test_high_sleep_raises_error(self, sr):
Expand All @@ -77,7 +77,7 @@ def test_releasing_lock_no_longer_owned_raises_error(self, sr):
with pytest.raises(LockError):
lock.release()
# even though we errored, the token is still cleared
assert lock.token is None
assert lock.local.token is None

def test_extend_lock(self, sr):
lock = self.get_lock(sr, 'foo', timeout=10)
Expand Down

0 comments on commit a48c2d8

Please sign in to comment.