# 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/db/sqlalchemy/migration.py
# INIT_VERSION = 0
# _REPO = None
#         _REPO = Repository(abspath)
# def db_sync(engine, version=None, init_version=INIT_VERSION):
# def db_version(engine, init_version=INIT_VERSION):
# def db_version_control(engine, version=None):
# def _find_migrate_repo():
# 
# 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 uuid
import sqlalchemy as sa
import testtools
from seedbox.db import exception
from seedbox.db.sqlalchemy import migration
from seedbox.db.sqlalchemy import session
from seedbox.tests import test




class DBMigrationTestCase(test.BaseTestCase):

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

    def test_db_version(self):
        dbname = 'sqlite:////tmp/' + str(uuid.uuid4()) + '.db'
        self.facade = session.EngineFacade(dbname)

        ver = migration.db_version(self.facade.engine)
        self.assertEqual(ver, 0)

    def test_db_sync(self):
        dbname = 'sqlite:////tmp/' + str(uuid.uuid4()) + '.db'
        self.facade = session.EngineFacade(dbname)


# 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/db/sqlalchemy/migration.py
# INIT_VERSION = 0
# _REPO = None
#         _REPO = Repository(abspath)
# def db_sync(engine, version=None, init_version=INIT_VERSION):
# def db_version(engine, init_version=INIT_VERSION):
# def db_version_control(engine, version=None):
# def _find_migrate_repo():
# 
# 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_migration.py
import uuid
import sqlalchemy as sa
import testtools
from seedbox.db import exception
from seedbox.db.sqlalchemy import migration
from seedbox.db.sqlalchemy import session
from seedbox.tests import test





class DBMigrationTestCase(test.BaseTestCase):

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

    def test_db_version(self):
        dbname = 'sqlite:////tmp/' + str(uuid.uuid4()) + '.db'
        self.facade = session.EngineFacade(dbname)

        ver = migration.db_version(self.facade.engine)
        self.assertEqual(ver, 0)

    def test_db_sync(self):
        dbname = 'sqlite:////tmp/' + str(uuid.uuid4()) + '.db'
        self.facade = session.EngineFacade(dbname)


        migration.db_sync(self.facade.engine)