# Path: seedbox/db/exception.py
# class DBError(Exception):
# class MultipleResultsFound(DBError):
# class NoResultFound(DBError):
# class DbMigrationError(DBError):
#     def __init__(self, inner_exception=None):
#     def __init__(self, message=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):


from seedbox.db import exception
from seedbox.tests import test



class DbExceptionTest(test.BaseTestCase):

    def test_db_error(self):

        def gen_error(an_error):
            raise exception.DBError(an_error)

        err = self.assertRaises(exception.DBError,
                                gen_error,
                                ValueError)
        self.assertEqual(ValueError, err.inner_exception)

    def test_multiple_results_error(self):

        def gen_error(an_error):
            raise exception.MultipleResultsFound(an_error)

        err = self.assertRaises(exception.MultipleResultsFound,
                                gen_error,
                                RuntimeError)
        self.assertEqual(RuntimeError, err.inner_exception)

    def test_no_results_error(self):

        def gen_error(an_error):
            raise exception.NoResultFound(an_error)


# Path: seedbox/db/exception.py
# class DBError(Exception):
# class MultipleResultsFound(DBError):
# class NoResultFound(DBError):
# class DbMigrationError(DBError):
#     def __init__(self, inner_exception=None):
#     def __init__(self, message=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/db/test_exception.py
from seedbox.db import exception
from seedbox.tests import test




class DbExceptionTest(test.BaseTestCase):

    def test_db_error(self):

        def gen_error(an_error):
            raise exception.DBError(an_error)

        err = self.assertRaises(exception.DBError,
                                gen_error,
                                ValueError)
        self.assertEqual(ValueError, err.inner_exception)

    def test_multiple_results_error(self):

        def gen_error(an_error):
            raise exception.MultipleResultsFound(an_error)

        err = self.assertRaises(exception.MultipleResultsFound,
                                gen_error,
                                RuntimeError)
        self.assertEqual(RuntimeError, err.inner_exception)

    def test_no_results_error(self):

        def gen_error(an_error):
            raise exception.NoResultFound(an_error)


        err = self.assertRaises(exception.NoResultFound,