Page MenuHomeSoftware Heritage

test_conftest.py
No OneTemporary

test_conftest.py

# Copyright (C) 2021-2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from swh.provenance.interface import ProvenanceInterface
from swh.provenance.tests.conftest import fill_storage, load_repo_data
from swh.storage.interface import StorageInterface
def test_provenance_fixture(provenance: ProvenanceInterface) -> None:
"""Check the 'provenance' fixture produce a working
ProvenanceStoragePostgreSql object"""
assert provenance
provenance.flush() # should be a noop
def test_fill_storage(swh_storage: StorageInterface) -> None:
"""Check the 'fill_storage' test utility produces a working Storage
object with at least some Content, Revision and Directory in it"""
data = load_repo_data("cmdbts2")
fill_storage(swh_storage, data)
assert swh_storage
assert swh_storage.content_get_random()
assert swh_storage.directory_get_random()
assert swh_storage.revision_get_random()

File Metadata

Mime Type
text/x-python
Expires
Fri, Jul 4, 11:56 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3266067

Event Timeline