# Path: bl/debug.py
# DEBUG = _Debug()
# 
# def setDebug(debug):
#     DEBUG.debug = bool(debug)
# 
# def debug(message):
#     if DEBUG:
#         log.msg(message)


from twisted.trial.unittest import TestCase
from bl.debug import DEBUG, setDebug, debug
import bl.debug



class DebugTests(TestCase):

    def setUp(self):
        self._debug = DEBUG.debug
        self.messages = []

        class Log:

            @classmethod
            def msg(cls, message):
                self.messages.append(message)

        self.patch(bl.debug, 'log', Log)

    def tearDown(self):
        DEBUG.debug = self._debug

    def test_setDebug(self):
        setDebug(False)
        self.failIf(DEBUG)
        setDebug(True)
        self.assert_(DEBUG)

    def test_debug(self):

# Path: bl/debug.py
# DEBUG = _Debug()
# 
# def setDebug(debug):
#     DEBUG.debug = bool(debug)
# 
# def debug(message):
#     if DEBUG:
#         log.msg(message)


# Path: bl/tests/test_debug.py
from twisted.trial.unittest import TestCase
from bl.debug import DEBUG, setDebug, debug
import bl.debug




class DebugTests(TestCase):

    def setUp(self):
        self._debug = DEBUG.debug
        self.messages = []

        class Log:

            @classmethod
            def msg(cls, message):
                self.messages.append(message)

        self.patch(bl.debug, 'log', Log)

    def tearDown(self):
        DEBUG.debug = self._debug

    def test_setDebug(self):
        setDebug(False)
        self.failIf(DEBUG)
        setDebug(True)
        self.assert_(DEBUG)

    def test_debug(self):

        setDebug(False)