Skip to content

Commit

Permalink
re-acquiring locks works without errors, closes #61
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 15, 2013
1 parent f770c41 commit cb203a9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions kazoo/tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ def test_lock_double_calls(self):
lock1.release()
lock1.release()

def test_lock_reacquire(self):
lock = self.client.Lock(self.lockpath, "one")
lock.acquire()
lock.release()
lock.acquire()
lock.release()


class TestSemaphore(KazooTestCase):
def setUp(self):
Expand Down Expand Up @@ -368,3 +375,10 @@ def test_inconsistent_max_leases_other_data(self):
sem1.acquire()
# sem2 thinks it's ok to have two lease holders
ok_(sem2.acquire(blocking=False))

def test_reacquire(self):
lock = self.client.Semaphore(self.lockpath)
lock.acquire()
lock.release()
lock.acquire()
lock.release()

0 comments on commit cb203a9

Please sign in to comment.