Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/storage/test_api_client.py
# Copyright (C) 2015-2019 The Software Heritage developers | # Copyright (C) 2015-2019 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import pytest | import pytest | ||||
from swh.indexer.storage import get_indexer_storage | from swh.indexer.storage import get_indexer_storage | ||||
from swh.indexer.storage.api.client import RemoteStorage | from swh.indexer.storage.api.client import RemoteStorage | ||||
import swh.indexer.storage.api.server as server | import swh.indexer.storage.api.server as server | ||||
from .test_storage import * # noqa | from .test_storage import * # noqa | ||||
@pytest.fixture | @pytest.fixture | ||||
def app(swh_indexer_storage_postgresql): | def app(swh_indexer_storage_postgresql): | ||||
server.storage = get_indexer_storage("local", db=swh_indexer_storage_postgresql.dsn) | server.storage = get_indexer_storage( | ||||
"local", | |||||
db=swh_indexer_storage_postgresql.dsn, | |||||
journal_writer={"cls": "memory",}, | |||||
) | |||||
return server.app | return server.app | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_rpc_client_class(): | def swh_rpc_client_class(): | ||||
# these are needed for the swh_indexer_storage_with_data fixture | # these are needed for the swh_indexer_storage_with_data fixture | ||||
assert hasattr(RemoteStorage, "indexer_configuration_add") | assert hasattr(RemoteStorage, "indexer_configuration_add") | ||||
assert hasattr(RemoteStorage, "content_mimetype_add") | assert hasattr(RemoteStorage, "content_mimetype_add") | ||||
Show All 10 Lines |