From c300b9267b92354f5beb1f7365812f132259dd3b Mon Sep 17 00:00:00 2001 From: Ilya Pekelny Date: Mon, 16 Dec 2013 17:36:30 +0200 Subject: [PATCH] Move db tests base.py to common code tests/unit/db/sqlalchemy/base.py moved to openstack/common/db/sqlalchemy/test_base.py for further reuse in other projects. Change-Id: I5cf83a63f148f48ff7c38a1ad4cc714f08e60fd1 --- .../base.py => openstack/common/db/sqlalchemy/test_base.py | 4 ++-- tests/unit/db/sqlalchemy/test_migrate.py | 2 +- tests/unit/db/sqlalchemy/test_migration_common.py | 4 ++-- tests/unit/db/sqlalchemy/test_models.py | 2 +- tests/unit/db/sqlalchemy/test_sqlalchemy.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) rename tests/unit/db/sqlalchemy/base.py => openstack/common/db/sqlalchemy/test_base.py (98%) diff --git a/tests/unit/db/sqlalchemy/base.py b/openstack/common/db/sqlalchemy/test_base.py similarity index 98% rename from tests/unit/db/sqlalchemy/base.py rename to openstack/common/db/sqlalchemy/test_base.py index 1a640862..62a77321 100644 --- a/tests/unit/db/sqlalchemy/base.py +++ b/openstack/common/db/sqlalchemy/test_base.py @@ -23,7 +23,7 @@ import six from openstack.common.db.sqlalchemy import session from openstack.common.db.sqlalchemy import utils -from tests import utils as test_utils +from openstack.common import test class DbFixture(fixtures.Fixture): @@ -52,7 +52,7 @@ class DbFixture(fixtures.Fixture): self.addCleanup(self.conf.reset) -class DbTestCase(test_utils.BaseTestCase): +class DbTestCase(test.BaseTestCase): """Base class for testing of DB code. Using `DbFixture`. Intended to be the main database test case to use all diff --git a/tests/unit/db/sqlalchemy/test_migrate.py b/tests/unit/db/sqlalchemy/test_migrate.py index 359e6d25..8ba5ddb8 100644 --- a/tests/unit/db/sqlalchemy/test_migrate.py +++ b/tests/unit/db/sqlalchemy/test_migrate.py @@ -19,7 +19,7 @@ import sqlalchemy as sa from openstack.common.db.sqlalchemy import migration from openstack.common.db.sqlalchemy import session -from tests.unit.db.sqlalchemy import base as test_base +from openstack.common.db.sqlalchemy import test_base def uniques(*constraints): diff --git a/tests/unit/db/sqlalchemy/test_migration_common.py b/tests/unit/db/sqlalchemy/test_migration_common.py index b5fa189e..c0648af1 100644 --- a/tests/unit/db/sqlalchemy/test_migration_common.py +++ b/tests/unit/db/sqlalchemy/test_migration_common.py @@ -26,10 +26,10 @@ import sqlalchemy from openstack.common.db import exception as db_exception from openstack.common.db.sqlalchemy import migration from openstack.common.db.sqlalchemy import session as db_session -from tests.unit.db.sqlalchemy import base +from openstack.common.db.sqlalchemy import test_base -class TestMigrationCommon(base.DbTestCase): +class TestMigrationCommon(test_base.DbTestCase): def setUp(self): super(TestMigrationCommon, self).setUp() diff --git a/tests/unit/db/sqlalchemy/test_models.py b/tests/unit/db/sqlalchemy/test_models.py index 36ea7bbe..216c622d 100644 --- a/tests/unit/db/sqlalchemy/test_models.py +++ b/tests/unit/db/sqlalchemy/test_models.py @@ -18,8 +18,8 @@ from sqlalchemy import Integer, String from sqlalchemy.ext.declarative import declarative_base from openstack.common.db.sqlalchemy import models +from openstack.common.db.sqlalchemy import test_base from openstack.common import test -from tests.unit.db.sqlalchemy import base as test_base BASE = declarative_base() diff --git a/tests/unit/db/sqlalchemy/test_sqlalchemy.py b/tests/unit/db/sqlalchemy/test_sqlalchemy.py index a429be48..4ed5146b 100644 --- a/tests/unit/db/sqlalchemy/test_sqlalchemy.py +++ b/tests/unit/db/sqlalchemy/test_sqlalchemy.py @@ -28,9 +28,9 @@ from sqlalchemy.ext.declarative import declarative_base from openstack.common.db import exception as db_exc from openstack.common.db.sqlalchemy import models from openstack.common.db.sqlalchemy import session +from openstack.common.db.sqlalchemy import test_base from openstack.common.fixture import config from openstack.common import test -from tests.unit.db.sqlalchemy import base as test_base BASE = declarative_base()