Changeset View
Changeset View
Standalone View
Standalone View
swh/vault/tests/test_git_bare_cooker.py
Show All 36 Lines | from swh.model.model import ( | ||||
RevisionType, | RevisionType, | ||||
Snapshot, | Snapshot, | ||||
SnapshotBranch, | SnapshotBranch, | ||||
TargetType, | TargetType, | ||||
Timestamp, | Timestamp, | ||||
TimestampWithTimezone, | TimestampWithTimezone, | ||||
) | ) | ||||
from swh.storage import get_storage | from swh.storage import get_storage | ||||
from swh.storage.postgresql.db import Db as StorageBackend | from swh.storage.postgresql.storage import Storage | ||||
from swh.vault.cookers.git_bare import GitBareCooker | from swh.vault.cookers.git_bare import GitBareCooker | ||||
from swh.vault.in_memory_backend import InMemoryVaultBackend | from swh.vault.in_memory_backend import InMemoryVaultBackend | ||||
storage_postgresql_proc = factories.postgresql_proc( | storage_postgresql_proc = factories.postgresql_proc( | ||||
load=[ | load=[partial(initialize_database_for_module, "storage", Storage.current_version)], | ||||
partial( | |||||
initialize_database_for_module, "storage", StorageBackend.current_version | |||||
) | |||||
], | |||||
) | ) | ||||
storage_postgresql = factories.postgresql("storage_postgresql_proc") | storage_postgresql = factories.postgresql("storage_postgresql_proc") | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage(storage_postgresql): | def swh_storage(storage_postgresql): | ||||
return get_storage("local", db=storage_postgresql.dsn, objstorage={"cls": "memory"}) | return get_storage("local", db=storage_postgresql.dsn, objstorage={"cls": "memory"}) | ||||
▲ Show 20 Lines • Show All 639 Lines • Show Last 20 Lines |