

def test_release_lock_with_path(self):
    flexmock(zk.ZKTransaction)
    fake_zookeeper = flexmock(name='fake_zoo', delete='delete')
    fake_zookeeper.should_receive('start')
    fake_zookeeper.should_receive('retry').with_args('delete', str)
    flexmock(kazoo.client)
    kazoo.client.should_receive('KazooClient').and_return(fake_zookeeper)
    transaction = zk.ZKTransaction(host='something', start_gc=False)
    self.assertEquals(True, transaction.release_lock_with_path('some/path'))
    fake_zookeeper.should_receive('retry').with_args('delete', str).and_raise(kazoo.exceptions.NoNodeError)
    self.assertRaises(ZKTransactionException, transaction.release_lock_with_path, 'some/path')

dataset/ETHPy150Open AppScale/appscale/AppDB/test/unit/test_zookeeper.py TestZookeeperTransaction.test_release_lock_with_path/original