# Path: tests/base.py
# class Test(unittest.TestCase):
#     test_timeout = 1
# 
#     def setUp(self):
#         import zorro
#         from zorro import zmq
#         self.z = zorro
#         self.hub = self.z.Hub()
#         self.thread = threading.Thread(target=self.hub.run)
# 
#     def tearDown(self):
#         if not self.hub.stopping:
#             self.hub.stop()
#         self.thread.join(self.test_timeout)
#         if self.thread.is_alive():
#             try:
#                 if not getattr(self, 'should_timeout', False):
#                     raise AssertionError("test timed out")
#             finally:
#                 self.hub.crash()
#                 self.thread.join()
#         for key in list(sys.modules.keys()):
#             if key == 'zorro' or key.startswith('zorro.'):
#                 del sys.modules[key]
# 
# def passive(zfun):
#     @wraps(zfun)
#     def wrapping(self, *a, **kw):
#         exc = []
#         def catch():
#             try:
#                 zfun(self, *a, **kw)
#             except BaseException as e:
#                 exc.append(e)
#         self.hub.add_task(catch)
#         self.thread.start()
#         try:
#             self.thread.join(self.test_timeout)
#         finally:
#             if exc:
#                 raise exc[0]
#     return wrapping


import socket
import unittest
import datetime
        import zorro.mysql
from functools import partial
from .base import Test, passive
        from zorro.mysql import Formatter
        from zorro.mysql import Formatter
        from datetime import date, time, datetime, timedelta
        from zorro.mysql import Formatter
# -*- coding: utf-8 -*-



class Mysql(Test):

    def setUp(self):
        super().setUp()
        self.m = zorro.mysql.Mysql()


class Simple(Mysql):


# Path: tests/base.py
# class Test(unittest.TestCase):
#     test_timeout = 1
# 
#     def setUp(self):
#         import zorro
#         from zorro import zmq
#         self.z = zorro
#         self.hub = self.z.Hub()
#         self.thread = threading.Thread(target=self.hub.run)
# 
#     def tearDown(self):
#         if not self.hub.stopping:
#             self.hub.stop()
#         self.thread.join(self.test_timeout)
#         if self.thread.is_alive():
#             try:
#                 if not getattr(self, 'should_timeout', False):
#                     raise AssertionError("test timed out")
#             finally:
#                 self.hub.crash()
#                 self.thread.join()
#         for key in list(sys.modules.keys()):
#             if key == 'zorro' or key.startswith('zorro.'):
#                 del sys.modules[key]
# 
# def passive(zfun):
#     @wraps(zfun)
#     def wrapping(self, *a, **kw):
#         exc = []
#         def catch():
#             try:
#                 zfun(self, *a, **kw)
#             except BaseException as e:
#                 exc.append(e)
#         self.hub.add_task(catch)
#         self.thread.start()
#         try:
#             self.thread.join(self.test_timeout)
#         finally:
#             if exc:
#                 raise exc[0]
#     return wrapping


# Path: tests/test_mysql.py
import socket
import unittest
import datetime
        import zorro.mysql
from functools import partial
from .base import Test, passive
        from zorro.mysql import Formatter
        from zorro.mysql import Formatter
        from datetime import date, time, datetime, timedelta
        from zorro.mysql import Formatter

# -*- coding: utf-8 -*-



class Mysql(Test):

    def setUp(self):
        super().setUp()
        self.m = zorro.mysql.Mysql()


class Simple(Mysql):


    @passive