You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
628 B
Python
35 lines
628 B
Python
|
|
import os
|
|
import sys
|
|
import unittest
|
|
|
|
import mock
|
|
|
|
import econtext.master
|
|
|
|
|
|
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
|
|
sys.path.append(DATA_DIR)
|
|
|
|
|
|
def set_debug():
|
|
import logging
|
|
logging.getLogger('econtext').setLevel(logging.DEBUG)
|
|
|
|
|
|
def data_path(suffix):
|
|
return os.path.join(DATA_DIR, suffix)
|
|
|
|
|
|
class BrokerMixin(object):
|
|
broker_class = econtext.master.Broker
|
|
|
|
def setUp(self):
|
|
super(BrokerMixin, self).setUp()
|
|
self.broker = self.broker_class()
|
|
|
|
def tearDown(self):
|
|
self.broker.shutdown()
|
|
self.broker.join()
|
|
super(BrokerMixin, self).tearDown()
|