diff options
author | Mark McLoughlin <markmc@redhat.com> | 2013-02-04 16:40:01 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2013-02-07 15:25:29 -0500 |
commit | 06d1156248566322a7932dddfb833f46a8f573b8 (patch) | |
tree | b3e6ac915b6b9fc2940815536d2ee0b12efe5e52 /tests/unit/db/sqlalchemy/test_sqlalchemy.py | |
parent | 1575b00bb383b35d0251a5f74e67c1b18d61e51d (diff) | |
download | oslo-06d1156248566322a7932dddfb833f46a8f573b8.tar.gz oslo-06d1156248566322a7932dddfb833f46a8f573b8.tar.xz oslo-06d1156248566322a7932dddfb833f46a8f573b8.zip |
Remove openstack.common.db.common
Since this only contains exceptions that are either used in session.py
or utils.py (not both), it seems sensible to move them into the modules
where they are used.
Also, remove the use of the Invalid base exception class since we don't
seem to be making use of the base class anywhere by catching it rather
than the more specialized exceptions.
Change-Id: Ib05bb2e0a9494e1dc60c60b8eee0e76b5d2ee555
Diffstat (limited to 'tests/unit/db/sqlalchemy/test_sqlalchemy.py')
-rw-r--r-- | tests/unit/db/sqlalchemy/test_sqlalchemy.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/unit/db/sqlalchemy/test_sqlalchemy.py b/tests/unit/db/sqlalchemy/test_sqlalchemy.py index 10f7e41..ea01bc8 100644 --- a/tests/unit/db/sqlalchemy/test_sqlalchemy.py +++ b/tests/unit/db/sqlalchemy/test_sqlalchemy.py @@ -29,7 +29,6 @@ from sqlalchemy import DateTime, Integer from openstack.common import context from openstack.common import exception -from openstack.common.db import common as common_db from openstack.common.db.sqlalchemy import models from openstack.common.db.sqlalchemy import session from tests import utils as test_utils @@ -118,7 +117,7 @@ class SessionErrorWrapperTestCase(test_utils.BaseTestCase): tbl2 = TmpTable() tbl2.update({'foo': 10}) - self.assertRaises(common_db.DBDuplicateEntry, tbl2.save) + self.assertRaises(session.DBDuplicateEntry, tbl2.save) def test_execute_wrapper(self): _session = session.get_session() @@ -131,5 +130,5 @@ class SessionErrorWrapperTestCase(test_utils.BaseTestCase): method = _session.query(TmpTable).\ filter_by(foo=10).\ update - self.assertRaises(common_db.DBDuplicateEntry, + self.assertRaises(session.DBDuplicateEntry, method, {'foo': 20}) |