# Path: zoonado/protocol/connect.py
# class ConnectRequest(Request):
#     """
#     """
#     parts = (
#         ("protocol_version", Int),
#         ("last_seen_zxid", Long),
#         ("timeout", Int),
#         ("session_id", Long),
#         ("password", Buffer),
#         ("read_only", Bool),
#     )
# 
# class ConnectResponse(Response):
#     """
#     """
#     parts = (
#         ("protocol_version", Int),
#         ("timeout", Int),
#         ("session_id", Long),
#         ("password", Buffer),
#     )
# 
# Path: zoonado/connection.py
# class Connection(object):
#     def __init__(self, host, port, watch_handler):
#     def connect(self):
#     def send_connect(self, request):
#     def start_read_loop(self):
#     def send(self, request, xid=None):
#         def handle_write(write_future):
#     def read_loop(self):
#     def read_response(self, initial_connect=False):
#     def abort(self, exception=exc.ConnectError):
#         def abort_pending(f):
#     def drain_all_pending(self):
#     def close(self, timeout):


from mock import patch, Mock, call
from tornado import testing, concurrent
from zoonado.protocol.connect import ConnectRequest, ConnectResponse
from zoonado import connection
                password=b'\x00',
                read_only=False,
            )
        )

        self.assertEqual(result, None)

    @patch.object(connection.Connection, "read_response")
    @testing.gen_test
    def test_send_connect(self, read_response):
        conn = connection.Connection("local", 9999, Mock())
        conn.stream = Mock()
        conn.stream.write.return_value = self.future_value(None)

        response = ConnectResponse(
            protocol_version=0,
            timeout=7000,
            session_id=123456,
            password=b"\xc3"
        )

        read_response.return_value = self.future_value(
            (
                23,  # xid
                123,  # zxid
                response,  # response
            )
        )

        result = yield conn.send_connect(

# Path: zoonado/protocol/connect.py
# class ConnectRequest(Request):
#     """
#     """
#     parts = (
#         ("protocol_version", Int),
#         ("last_seen_zxid", Long),
#         ("timeout", Int),
#         ("session_id", Long),
#         ("password", Buffer),
#         ("read_only", Bool),
#     )
# 
# class ConnectResponse(Response):
#     """
#     """
#     parts = (
#         ("protocol_version", Int),
#         ("timeout", Int),
#         ("session_id", Long),
#         ("password", Buffer),
#     )
# 
# Path: zoonado/connection.py
# class Connection(object):
#     def __init__(self, host, port, watch_handler):
#     def connect(self):
#     def send_connect(self, request):
#     def start_read_loop(self):
#     def send(self, request, xid=None):
#         def handle_write(write_future):
#     def read_loop(self):
#     def read_response(self, initial_connect=False):
#     def abort(self, exception=exc.ConnectError):
#         def abort_pending(f):
#     def drain_all_pending(self):
#     def close(self, timeout):


# Path: tests/test_connection.py
from mock import patch, Mock, call
from tornado import testing, concurrent
from zoonado.protocol.connect import ConnectRequest, ConnectResponse
from zoonado import connection

                password=b'\x00',
                read_only=False,
            )
        )

        self.assertEqual(result, None)

    @patch.object(connection.Connection, "read_response")
    @testing.gen_test
    def test_send_connect(self, read_response):
        conn = connection.Connection("local", 9999, Mock())
        conn.stream = Mock()
        conn.stream.write.return_value = self.future_value(None)

        response = ConnectResponse(
            protocol_version=0,
            timeout=7000,
            session_id=123456,
            password=b"\xc3"
        )

        read_response.return_value = self.future_value(
            (
                23,  # xid
                123,  # zxid
                response,  # response
            )
        )

        result = yield conn.send_connect(

            ConnectRequest(