summaryrefslogtreecommitdiff
path: root/tests/sqlalchemy/test_utils.py
diff options
context:
space:
mode:
authorOleksii Chuprykov <ochuprykov@mirantis.com>2014-07-14 13:31:42 +0300
committerOleksii Chuprykov <ochuprykov@mirantis.com>2014-07-15 17:21:48 +0300
commit108e2bddb4fd44b023170deeb86893c342295fd5 (patch)
tree2c0318dd98ab823bd36c6e5556bc15d963bc66e7 /tests/sqlalchemy/test_utils.py
parenteff37a21b2c35b632462b5b7978647811889bfe6 (diff)
downloadoslo-db-108e2bddb4fd44b023170deeb86893c342295fd5.tar.gz
Move all db exception to exception.py
Moving InvalidSortKey, ColumnError from oslo/db/sqlalchemy/utils.py to oslo/db/exception.py for ease of use. Add references in utils.py to exception py for backwards compatibility. Change-Id: I38595d6bcceee84ef0ca7d88dae5617c006ba8c1
Diffstat (limited to 'tests/sqlalchemy/test_utils.py')
-rw-r--r--tests/sqlalchemy/test_utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/sqlalchemy/test_utils.py b/tests/sqlalchemy/test_utils.py
index a24a83a..17cec1c 100644
--- a/tests/sqlalchemy/test_utils.py
+++ b/tests/sqlalchemy/test_utils.py
@@ -133,7 +133,7 @@ class TestPaginateQuery(test_base.BaseTestCase):
sqlalchemy.asc('user').AndReturn('asc')
self.query.order_by('asc').AndReturn(self.query)
self.mox.ReplayAll()
- self.assertRaises(utils.InvalidSortKey,
+ self.assertRaises(exception.InvalidSortKey,
utils.paginate_query, self.query,
self.model, 5, ['user_id', 'non-existent key'])
@@ -364,7 +364,7 @@ class TestMigrationUtils(test_migrations.BaseMigrationTestCase):
# reflection of custom types has been fixed upstream
if SA_VERSION < (0, 9, 0):
- self.assertRaises(utils.ColumnError,
+ self.assertRaises(exception.ColumnError,
utils.change_deleted_column_type_to_id_type,
engine, table_name)
@@ -434,7 +434,7 @@ class TestMigrationUtils(test_migrations.BaseMigrationTestCase):
# reflection of custom types has been fixed upstream
if SA_VERSION < (0, 9, 0):
- self.assertRaises(utils.ColumnError,
+ self.assertRaises(exception.ColumnError,
utils.change_deleted_column_type_to_boolean,
engine, table_name)
@@ -539,13 +539,13 @@ class TestMigrationUtils(test_migrations.BaseMigrationTestCase):
if SA_VERSION < (0, 9, 0):
# NOTE(boris-42): Missing info about column `foo` that has
# unsupported type CustomType.
- self.assertRaises(utils.ColumnError,
+ self.assertRaises(exception.ColumnError,
utils.drop_unique_constraint,
engine, table_name, uc_name, 'foo')
# NOTE(boris-42): Wrong type of foo instance. it should be
# instance of sqlalchemy.Column.
- self.assertRaises(utils.ColumnError,
+ self.assertRaises(exception.ColumnError,
utils.drop_unique_constraint,
engine, table_name, uc_name, 'foo',
foo=Integer())