# Path: habitat/utils/startup.py
# def load_config():
# def _get_logging_level(value):
#     def emit(self, record):
# def setup_logging(config, daemon_name):
# def main(main_class):
# class null_logger(logging.Handler):


import sys
import tempfile
import mox
import smtplib
import copy
import logging
import os
import os.path
from ...utils import startup
            smtp.sendmail("from_bob", ["addr_1", "addr_2"], EqIfIn(*things))
            smtp.quit()

        self.mocker.ReplayAll()

        startup.setup_logging(self.config, "mydaemon")
        self.generate_log_messages()

        self.mocker.VerifyAll()

    def test_silent(self):
        self.mocker.StubOutWithMock(sys, 'stdout')
        self.mocker.StubOutWithMock(sys, 'stderr')
        # No output on std{err,out}

        self.mocker.ReplayAll()

        startup.setup_logging(self.config, "mydaemon")
        self.generate_log_messages()

        self.mocker.VerifyAll()

class TestMain(object):
    def setup(self):
        self.mocker = mox.Mox()

    def teardown(self):
        self.mocker.UnsetStubs()

    def test_works(self):

# Path: habitat/utils/startup.py
# def load_config():
# def _get_logging_level(value):
#     def emit(self, record):
# def setup_logging(config, daemon_name):
# def main(main_class):
# class null_logger(logging.Handler):


# Path: habitat/tests/test_utils/test_startup.py
import sys
import tempfile
import mox
import smtplib
import copy
import logging
import os
import os.path
from ...utils import startup

            smtp.sendmail("from_bob", ["addr_1", "addr_2"], EqIfIn(*things))
            smtp.quit()

        self.mocker.ReplayAll()

        startup.setup_logging(self.config, "mydaemon")
        self.generate_log_messages()

        self.mocker.VerifyAll()

    def test_silent(self):
        self.mocker.StubOutWithMock(sys, 'stdout')
        self.mocker.StubOutWithMock(sys, 'stderr')
        # No output on std{err,out}

        self.mocker.ReplayAll()

        startup.setup_logging(self.config, "mydaemon")
        self.generate_log_messages()

        self.mocker.VerifyAll()

class TestMain(object):
    def setup(self):
        self.mocker = mox.Mox()

    def teardown(self):
        self.mocker.UnsetStubs()

    def test_works(self):

        self.mocker.StubOutWithMock(startup, 'load_config')