# Path: kiel/zookeeper/party.py
# class Party(object):
#     def __init__(self, client, member_name, path, on_change):
#     def start(self):
#         def member_change(members):
#     def join(self):
#     def leave(self):


import unittest
from mock import Mock
from kazoo.exceptions import NoNodeError
from kiel.zookeeper import party




class PartyTests(unittest.TestCase):

    def test_start_ensures_path_and_watches_changes(self):
        client = Mock()

        def collect_callback(fn):
            client.change_callback = fn

        client.ChildrenWatch.return_value.side_effect = collect_callback

        on_change = Mock()


# Path: kiel/zookeeper/party.py
# class Party(object):
#     def __init__(self, client, member_name, path, on_change):
#     def start(self):
#         def member_change(members):
#     def join(self):
#     def leave(self):


# Path: tests/zookeeper/test_party.py
import unittest
from mock import Mock
from kazoo.exceptions import NoNodeError
from kiel.zookeeper import party





class PartyTests(unittest.TestCase):

    def test_start_ensures_path_and_watches_changes(self):
        client = Mock()

        def collect_callback(fn):
            client.change_callback = fn

        client.ChildrenWatch.return_value.side_effect = collect_callback

        on_change = Mock()


        p = party.Party(client, "host.local", "/my/party", on_change)