oslo_db.sqlalchemy.test_base

class oslo_db.sqlalchemy.test_base.DbFixture(test)

Bases: fixtures.fixture.Fixture

Basic database fixture.

Allows to run tests on various db backends, such as SQLite, MySQL and PostgreSQL. By default use sqlite backend. To override default backend uri set env variable OS_TEST_DBAPI_CONNECTION with database admin credentials for specific backend.

DBNAME = 'openstack_citest'
DRIVER = 'sqlite'
PASSWORD = 'openstack_citest'
USERNAME = 'openstack_citest'
setUp()
class oslo_db.sqlalchemy.test_base.DbTestCase(*args, **kwds)

Bases: oslotest.base.BaseTestCase

Base class for testing of DB code.

Using DbFixture. Intended to be the main database test case to use all the tests on a given backend with user defined uri. Backend specific tests should be decorated with backend_specific decorator.

FIXTURE

alias of DbFixture

setUp()
class oslo_db.sqlalchemy.test_base.MySQLOpportunisticFixture(test)

Bases: oslo_db.sqlalchemy.test_base.DbFixture

DRIVER = 'mysql'
class oslo_db.sqlalchemy.test_base.MySQLOpportunisticTestCase(*args, **kwds)

Bases: oslo_db.sqlalchemy.test_base.OpportunisticTestCase

FIXTURE

alias of MySQLOpportunisticFixture

class oslo_db.sqlalchemy.test_base.OpportunisticTestCase(*args, **kwds)

Bases: oslo_db.sqlalchemy.test_base.DbTestCase

Placeholder for backwards compatibility.

class oslo_db.sqlalchemy.test_base.PostgreSQLOpportunisticFixture(test)

Bases: oslo_db.sqlalchemy.test_base.DbFixture

DRIVER = 'postgresql'
class oslo_db.sqlalchemy.test_base.PostgreSQLOpportunisticTestCase(*args, **kwds)

Bases: oslo_db.sqlalchemy.test_base.OpportunisticTestCase

FIXTURE

alias of PostgreSQLOpportunisticFixture

oslo_db.sqlalchemy.test_base.backend_specific(*dialects)

Decorator to skip backend specific tests on inappropriate engines.

::dialects: list of dialects names under which the test will be launched.

Previous topic

oslo_db.sqlalchemy.session

Next topic

oslo_db.sqlalchemy.test_migrations

This Page