Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/conftest.py
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | def swh_storage(postgresql_proc, swh_storage_postgresql): | ||||
} | } | ||||
storage = swh.storage.get_storage(**storage_config) | storage = swh.storage.get_storage(**storage_config) | ||||
return storage | return storage | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_contents(swh_storage): | def swh_contents(swh_storage): | ||||
contents = gen_contents(n=20) | contents = gen_contents(n=20) | ||||
swh_storage.content_add(contents) | swh_storage.content_add( | ||||
[c for c in contents if c['status'] != 'absent']) | |||||
swh_storage.skipped_content_add( | |||||
[c for c in contents if c['status'] == 'absent']) | |||||
return contents | return contents | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_origins(swh_storage): | def swh_origins(swh_storage): | ||||
origins = gen_origins(n=100) | origins = gen_origins(n=100) | ||||
swh_storage.origin_add(origins) | swh_storage.origin_add(origins) | ||||
return origins | return origins | ||||
▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | Returns: | ||||
origin) | origin) | ||||
""" | """ | ||||
from .storage_data import data | from .storage_data import data | ||||
return { | return { | ||||
'content': [data.cont, data.cont2], | 'content': [data.cont, data.cont2], | ||||
'content_metadata': [data.cont3], | 'content_metadata': [data.cont3], | ||||
'skipped_content': [data.skipped_cont, data.skipped_cont2], | |||||
'person': [data.person], | 'person': [data.person], | ||||
'directory': [data.dir2, data.dir], | 'directory': [data.dir2, data.dir], | ||||
'revision': [data.revision], | 'revision': [data.revision], | ||||
'release': [data.release, data.release2, data.release3], | 'release': [data.release, data.release2, data.release3], | ||||
'snapshot': [data.snapshot], | 'snapshot': [data.snapshot], | ||||
'origin': [data.origin, data.origin2], | 'origin': [data.origin, data.origin2], | ||||
'tool': [data.metadata_tool], | 'tool': [data.metadata_tool], | ||||
'provider': [data.provider], | 'provider': [data.provider], | ||||
'origin_metadata': [data.origin_metadata, data.origin_metadata2], | 'origin_metadata': [data.origin_metadata, data.origin_metadata2], | ||||
} | } |