# Path: seedbox/service.py
# PROJECT = __package__
# DEFAULT_LIBRARY_LOG_LEVEL = {'xworkflows': logging.ERROR,
#                              'stevedore': logging.ERROR,
#                              'sqlalchemy': logging.ERROR,
#                              'migrate': logging.ERROR,
#                              }
# CONSOLE_MESSAGE_FORMAT = '%(message)s'
# LOG_FILE_MESSAGE_FORMAT = '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
# def _setup_logging():
# def _configure(args):
# def prepare_service(args=None):
# 
# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):


import logging
import logging.handlers
import os
import shutil
import tempfile
import fixtures
from oslo_config import cfg
from testtools import matchers
from seedbox import service
from seedbox.tests import test
        self.CONF.set_override('logconfig', logfile)
        service._setup_logging()
        root = logging.getLogger()
        self.assertEqual(logging.DEBUG, root.getEffectiveLevel())

    def test_configure_with_venv(self):

        cfg.CONF.reset()
        cfg.CONF.import_opt('base_client_path', 'seedbox.options')

        vdir = tempfile.mkdtemp()
        dirname = os.path.join(vdir, 'etc')
        os.mkdir(dirname)

        with fixtures.EnvironmentVariable('VIRTUAL_ENV', vdir):
            cfgfile = self.create_tempfiles(
                [(os.path.join(dirname, 'seedbox'),
                  ''.join(self.cfg_data))])[0]
            self.addCleanup(shutil.rmtree, os.path.dirname(cfgfile), True)
            service._configure([])
            self.assertEqual(cfg.CONF.base_client_path,
                             '/home/shad/torrent-test/deluge')

    def test_configure_without_venv(self):

        cfg.CONF.reset()
        cfg.CONF.import_opt('base_client_path', 'seedbox.options')

        with fixtures.EnvironmentVariable('VIRTUAL_ENV'):
            cfgfile = self.create_tempfiles(

# Path: seedbox/service.py
# PROJECT = __package__
# DEFAULT_LIBRARY_LOG_LEVEL = {'xworkflows': logging.ERROR,
#                              'stevedore': logging.ERROR,
#                              'sqlalchemy': logging.ERROR,
#                              'migrate': logging.ERROR,
#                              }
# CONSOLE_MESSAGE_FORMAT = '%(message)s'
# LOG_FILE_MESSAGE_FORMAT = '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
# def _setup_logging():
# def _configure(args):
# def prepare_service(args=None):
# 
# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):


# Path: seedbox/tests/test_service.py
import logging
import logging.handlers
import os
import shutil
import tempfile
import fixtures
from oslo_config import cfg
from testtools import matchers
from seedbox import service
from seedbox.tests import test

        self.CONF.set_override('logconfig', logfile)
        service._setup_logging()
        root = logging.getLogger()
        self.assertEqual(logging.DEBUG, root.getEffectiveLevel())

    def test_configure_with_venv(self):

        cfg.CONF.reset()
        cfg.CONF.import_opt('base_client_path', 'seedbox.options')

        vdir = tempfile.mkdtemp()
        dirname = os.path.join(vdir, 'etc')
        os.mkdir(dirname)

        with fixtures.EnvironmentVariable('VIRTUAL_ENV', vdir):
            cfgfile = self.create_tempfiles(
                [(os.path.join(dirname, 'seedbox'),
                  ''.join(self.cfg_data))])[0]
            self.addCleanup(shutil.rmtree, os.path.dirname(cfgfile), True)
            service._configure([])
            self.assertEqual(cfg.CONF.base_client_path,
                             '/home/shad/torrent-test/deluge')

    def test_configure_without_venv(self):

        cfg.CONF.reset()
        cfg.CONF.import_opt('base_client_path', 'seedbox.options')

        with fixtures.EnvironmentVariable('VIRTUAL_ENV'):
            cfgfile = self.create_tempfiles(

                [(os.path.join(os.path.expanduser('~'),