Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_tenacious.py
Show All 30 Lines | collections = { | ||||
"directory": data.directories, | "directory": data.directories, | ||||
"release": data.releases, | "release": data.releases, | ||||
"snapshot": data.snapshots, | "snapshot": data.snapshots, | ||||
} | } | ||||
# generic storage tests (using imported TestStorage* classes) | # generic storage tests (using imported TestStorage* classes) | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage_backend_config2(): | def swh_storage_backend_config(): | ||||
yield { | yield { | ||||
"cls": "memory", | "cls": "memory", | ||||
"journal_writer": { | "journal_writer": { | ||||
"cls": "memory", | "cls": "memory", | ||||
}, | }, | ||||
} | } | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage(): | def swh_storage(swh_storage_backend, swh_storage_backend_config): | ||||
storage_config = { | storage_config = { | ||||
"cls": "pipeline", | "cls": "pipeline", | ||||
"steps": [ | "steps": [ | ||||
{"cls": "tenacious"}, | {"cls": "tenacious"}, | ||||
{ | swh_storage_backend_config, | ||||
"cls": "memory", | |||||
"journal_writer": { | |||||
"cls": "memory", | |||||
}, | |||||
}, | |||||
], | ], | ||||
} | } | ||||
storage = get_storage(**storage_config) | storage = get_storage(**storage_config) | ||||
storage.storage = swh_storage_backend # use the same instance of the in-mem backend | |||||
storage.journal_writer = storage.storage.journal_writer | storage.journal_writer = storage.storage.journal_writer | ||||
return storage | return storage | ||||
class TestTenaciousStorage(_TestStorage): | class TestTenaciousStorage(_TestStorage): | ||||
@pytest.mark.skip( | @pytest.mark.skip( | ||||
'The "person" table of the pgsql is a legacy thing, and not ' | 'The "person" table of the pgsql is a legacy thing, and not ' | ||||
"supported by the cassandra/in-memory backend." | "supported by the cassandra/in-memory backend." | ||||
▲ Show 20 Lines • Show All 359 Lines • Show Last 20 Lines |