# Path: seedbox/db/sqlalchemy/session.py
# @property
# def session(self):
#     """Get a Session instance."""
#     return self._session_maker()
# 
# 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 mock
from seedbox.db.sqlalchemy import session
from seedbox.tests import test
    def setUp(self):
        super(EngineFacadeTestCase, self).setUp()

        self.facade = session.EngineFacade('sqlite://')

    def test_get_engine(self):
        eng1 = self.facade.engine
        eng2 = self.facade.engine

        self.assertIs(eng1, eng2)

    def test_get_session(self):
        ses1 = self.facade.session
        ses2 = self.facade.session

        self.assertIsNot(ses1, ses2)

    def test_get_session_maker(self):
        sm1 = self.facade.session_maker
        sm2 = self.facade.session_maker

        self.assertIs(sm1, sm2)

    def test_create_engine(self):

        session.create_engine('sqlite:///:memory:')
        self.assertEqual(
            logging.getLogger('sqlalchemy.engine').getEffectiveLevel(),
            logging.WARNING)


# Path: seedbox/db/sqlalchemy/session.py
# @property
# def session(self):
#     """Get a Session instance."""
#     return self._session_maker()
# 
# 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/db/sqlalchemy/test_session.py
import logging
import mock
from seedbox.db.sqlalchemy import session
from seedbox.tests import test

    def setUp(self):
        super(EngineFacadeTestCase, self).setUp()

        self.facade = session.EngineFacade('sqlite://')

    def test_get_engine(self):
        eng1 = self.facade.engine
        eng2 = self.facade.engine

        self.assertIs(eng1, eng2)

    def test_get_session(self):
        ses1 = self.facade.session
        ses2 = self.facade.session

        self.assertIsNot(ses1, ses2)

    def test_get_session_maker(self):
        sm1 = self.facade.session_maker
        sm2 = self.facade.session_maker

        self.assertIs(sm1, sm2)

    def test_create_engine(self):

        session.create_engine('sqlite:///:memory:')
        self.assertEqual(
            logging.getLogger('sqlalchemy.engine').getEffectiveLevel(),
            logging.WARNING)


        session.create_engine('sqlite:///:memory:',