# Path: haigha/transports/event_transport.py
# class EventTransport(Transport):
#     def __init__(self, *args):
#     def _sock_close_cb(self, sock):
#     def _sock_error_cb(self, sock, msg, exception=None):
#     def _sock_read_cb(self, sock):
#     def connect(self, (host, port)):
#     def read(self, timeout=None):
#     def buffer(self, data):
#     def write(self, data):
#     def disconnect(self):


from chai import Chai
from haigha.transports import event_transport
from haigha.transports.event_transport import *
'''




class EventTransportTest(Chai):

    def setUp(self):
        super(EventTransportTest, self).setUp()

        self.connection = mock()
        self.transport = EventTransport(self.connection)
        self.transport._host = 'server'

    def test_sock_close_cb(self):
        expect(self.connection.transport_closed).args(
            msg='socket to server closed unexpectedly')
        self.transport._sock_close_cb('sock')

    def test_sock_error_cb(self):
        expect(self.connection.transport_closed).args(
            msg='error on connection to server: amsg')
        self.transport._sock_error_cb('sock', 'amsg')

    def test_sock_read_cb(self):
        expect(self.connection.read_frames)
        self.transport._sock_read_cb('sock')

    def test_connect(self):
        sock = mock()

# Path: haigha/transports/event_transport.py
# class EventTransport(Transport):
#     def __init__(self, *args):
#     def _sock_close_cb(self, sock):
#     def _sock_error_cb(self, sock, msg, exception=None):
#     def _sock_read_cb(self, sock):
#     def connect(self, (host, port)):
#     def read(self, timeout=None):
#     def buffer(self, data):
#     def write(self, data):
#     def disconnect(self):


# Path: tests/unit/transports/event_transport_test.py
from chai import Chai
from haigha.transports import event_transport
from haigha.transports.event_transport import *

'''




class EventTransportTest(Chai):

    def setUp(self):
        super(EventTransportTest, self).setUp()

        self.connection = mock()
        self.transport = EventTransport(self.connection)
        self.transport._host = 'server'

    def test_sock_close_cb(self):
        expect(self.connection.transport_closed).args(
            msg='socket to server closed unexpectedly')
        self.transport._sock_close_cb('sock')

    def test_sock_error_cb(self):
        expect(self.connection.transport_closed).args(
            msg='error on connection to server: amsg')
        self.transport._sock_error_cb('sock', 'amsg')

    def test_sock_read_cb(self):
        expect(self.connection.read_frames)
        self.transport._sock_read_cb('sock')

    def test_connect(self):
        sock = mock()

        mock(event_transport, 'EventSocket')