Skip to content

Commit

Permalink
Adapt existing test for the new lock owner property. Refers to ionelm…
Browse files Browse the repository at this point in the history
  • Loading branch information
jweyrich committed Dec 29, 2014
1 parent 49a5e0e commit 1156cda
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_redis_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ def test_reset_all(redis_server):
lock2.release()


def test_token(redis_server):
def test_owner_id(redis_server):
conn = StrictRedis(unix_socket_path=UDS_PATH)
lock = Lock(conn, "foobar-tok")
tok = lock.token
assert conn.get(lock._name) is None
unique_identifier = "foobar-identifier"
lock = Lock(conn, "foobar-tok", expire=TIMEOUT/4, id=unique_identifier)
lock_id = lock.id
assert lock_id == unique_identifier
lock.acquire(blocking=False)
assert conn.get(lock._name) == tok
assert lock.get_owner_id() == unique_identifier
lock.release()

0 comments on commit 1156cda

Please sign in to comment.