Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/conftest.py
Show First 20 Lines • Show All 816 Lines • ▼ Show 20 Lines | |||||
# Fixture to manipulate indexer data from a sample archive used in the tests | # Fixture to manipulate indexer data from a sample archive used in the tests | ||||
@pytest.fixture(scope="function") | @pytest.fixture(scope="function") | ||||
def indexer_data(tests_data): | def indexer_data(tests_data): | ||||
return _IndexerData(tests_data) | return _IndexerData(tests_data) | ||||
# Custom data directory for requests_mock | |||||
@pytest.fixture | |||||
def datadir(): | |||||
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "resources") | |||||
class _ArchiveData: | class _ArchiveData: | ||||
""" | """ | ||||
Helper class to manage data from a sample test archive. | Helper class to manage data from a sample test archive. | ||||
It is initialized with a reference to an in-memory storage | It is initialized with a reference to an in-memory storage | ||||
containing raw tests data. | containing raw tests data. | ||||
It is basically a proxy to Storage interface but it overrides some methods | It is basically a proxy to Storage interface but it overrides some methods | ||||
▲ Show 20 Lines • Show All 423 Lines • Show Last 20 Lines |