# Path: ejtp/util/compat.py

# 
# Path: ejtp/tests/tools.py
# class TestCaseWithLog(unittest.TestCase):
# 
#     def setUp(self):
#         from ejtp.util.compat import StringIO
#         self._stream = StringIO()
# 
#     def listen(self, logger):
#         import logging
#         handler = logging.StreamHandler(self._stream)
#         formatter = logging.Formatter('%(levelname)s:%(name)s: %(message)s')
#         handler.setFormatter(formatter)
#         logger.setLevel(logging.INFO)
#         logger.addHandler(handler)
# 
#     def assertInLog(self, expected):
#         value = self._stream.getvalue()
#         try:
#             self.assertIn(expected, value)
#         except AssertionError:
#             self.assertIn(expected, value.replace("u'", "'"))


from ejtp.util.compat import unittest
from ejtp.tests.tools import TestCaseWithLog
        from ejtp.router import Router
        from ejtp.applications.daemon import DaemonClient, ControllerClient, logger
        from ejtp.client import Client


class TestDaemon(TestCaseWithLog):

    def setUp(self):
        TestCaseWithLog.setUp(self)
        router  = Router()
        ifaces = {
            'daemon': ['local', None, 'c1'],
            'control': ['local', None, 'c2'],
        }
        self.daemon = DaemonClient(router, ifaces['daemon'], ifaces['control'], make_jack = False)

# Path: ejtp/util/compat.py

# 
# Path: ejtp/tests/tools.py
# class TestCaseWithLog(unittest.TestCase):
# 
#     def setUp(self):
#         from ejtp.util.compat import StringIO
#         self._stream = StringIO()
# 
#     def listen(self, logger):
#         import logging
#         handler = logging.StreamHandler(self._stream)
#         formatter = logging.Formatter('%(levelname)s:%(name)s: %(message)s')
#         handler.setFormatter(formatter)
#         logger.setLevel(logging.INFO)
#         logger.addHandler(handler)
# 
#     def assertInLog(self, expected):
#         value = self._stream.getvalue()
#         try:
#             self.assertIn(expected, value)
#         except AssertionError:
#             self.assertIn(expected, value.replace("u'", "'"))


# Path: ejtp/tests/applications/test_daemon.py
from ejtp.util.compat import unittest
from ejtp.tests.tools import TestCaseWithLog
        from ejtp.router import Router
        from ejtp.applications.daemon import DaemonClient, ControllerClient, logger
        from ejtp.client import Client



class TestDaemon(TestCaseWithLog):

    def setUp(self):
        TestCaseWithLog.setUp(self)
        router  = Router()
        ifaces = {
            'daemon': ['local', None, 'c1'],
            'control': ['local', None, 'c2'],
        }
        self.daemon = DaemonClient(router, ifaces['daemon'], ifaces['control'], make_jack = False)

        self.control = ControllerClient(router, ifaces['control'], ifaces['daemon'], make_jack = False)