| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
from oslo_db.sqlalchemy import enginefacade |
| 17 |
from oslo_db.sqlalchemy.test_base import backend_specific |
| 18 |
from oslo_db.sqlalchemy import test_fixtures as db_fixtures |
| 19 |
from oslo_db.tests import base as test_base |
| 20 |
|
| 21 |
|
| 22 |
@enginefacade.transaction_context_provider |
| 23 |
class Context: |
| 24 |
pass |
| 25 |
|
| 26 |
|
| 27 |
context = Context() |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
class _DbTestCase( |
| 34 |
db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase, |
| 35 |
): |
| 36 |
|
| 37 |
def setUp(self): |
| 38 |
super().setUp() |
| 39 |
|
| 40 |
self.engine = enginefacade.writer.get_engine() |
| 41 |
self.sessionmaker = enginefacade.writer.get_sessionmaker() |
| 42 |
|
| 43 |
|
| 44 |
class _MySQLOpportunisticTestCase(_DbTestCase): |
| 45 |
FIXTURE = db_fixtures.MySQLOpportunisticFixture |
| 46 |
|
| 47 |
|
| 48 |
class _PostgreSQLOpportunisticTestCase(_DbTestCase): |
| 49 |
FIXTURE = db_fixtures.PostgresqlOpportunisticFixture |