swh.storage.pytest_plugin module

swh.storage.pytest_plugin.postgresql_fact(process_fixture_name, db_name=None, dump_files='/home/jenkins/workspace/DDOC/publish/swh-docs/.tox/sphinx/lib/python3.7/site-packages/swh/storage/sql/*.sql')[source]
swh.storage.pytest_plugin.swh_storage_postgresql(request)

Fixture factory for PostgreSQL.

Parameters

request (FixtureRequest) – fixture request object

Return type

psycopg2.connection

Returns

postgresql client

swh.storage.pytest_plugin.swh_storage_backend_config(swh_storage_postgresql)[source]

Basic pg storage configuration with no journal collaborator (to avoid pulling optional dependency on clients of this fixture)

swh.storage.pytest_plugin.swh_storage(swh_storage_backend_config)[source]
class swh.storage.pytest_plugin.SwhDatabaseJanitor(user: str, host: str, port: str, db_name: str, version: Union[str, float, pkg_resources.extern.packaging.version.Version], dump_files: str = '/home/jenkins/workspace/DDOC/publish/swh-docs/.tox/sphinx/lib/python3.7/site-packages/swh/storage/sql/*.sql')[source]

Bases: pytest_postgresql.janitor.DatabaseJanitor

db_setup()[source]
db_reset()[source]
init()[source]

Create database in postgresql.

drop()[source]

Drop database in postgresql.

swh.storage.pytest_plugin.sample_data() → swh.storage.tests.storage_data.StorageData[source]

Pre-defined sample storage object data to manipulate

Returns

StorageData whose attribute keys are data model objects. Either multiple objects: contents, directories, revisions, releases, … or simple ones: content, directory, revision, release, …