Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/pypi/tests/test_pypi.py
Show First 20 Lines • Show All 861 Lines • ▼ Show 20 Lines | known_artifacts = { | ||||
"original_artifact": [{"checksums": {"sha256": "something-wrong"},}], | "original_artifact": [{"checksums": {"sha256": "something-wrong"},}], | ||||
}, | }, | ||||
} | } | ||||
assert artifact_to_revision_id(known_artifacts, artifact_metadata) == hash_to_bytes( | assert artifact_to_revision_id(known_artifacts, artifact_metadata) == hash_to_bytes( | ||||
"b11ebac8c9d0c9e5063a2df693a18e3aba4b2f92" | "b11ebac8c9d0c9e5063a2df693a18e3aba4b2f92" | ||||
) | ) | ||||
# there should not be more than one artifact | |||||
with pytest.raises(ValueError): | |||||
PyPILoader.known_artifact_to_extid( | |||||
{ | |||||
"original_artifact": [ | |||||
{"checksums": {"sha256": sha256,},}, | |||||
{"checksums": {"sha256": sha256,},}, | |||||
], | |||||
} | |||||
) | |||||
def test_pypi_artifact_with_no_intrinsic_metadata(swh_storage, requests_mock_datadir): | def test_pypi_artifact_with_no_intrinsic_metadata(swh_storage, requests_mock_datadir): | ||||
"""Skip artifact with no intrinsic metadata during ingestion | """Skip artifact with no intrinsic metadata during ingestion | ||||
""" | """ | ||||
url = "https://pypi.org/project/upymenu" | url = "https://pypi.org/project/upymenu" | ||||
loader = PyPILoader(swh_storage, url) | loader = PyPILoader(swh_storage, url) | ||||
Show All 25 Lines |