mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3870a6ff98>
def test_pypi_3(mocker):
"""Tests loading a revision generated by a very old PyPI loader that
does not have a provider or has 'project' metadata."""
mocker.patch(
"swh.storage.migrate_extrinsic_metadata.urlopen",
side_effect=urllib.error.HTTPError(None, 404, "Not Found", None, None),
)
source_original_artifact = {
"url": "https://files.pythonhosted.org/packages/34/4f/30087f22eaae8ad7077a28ce157342745a2977e264b8a8e4e7f804a8aa5e/PyPDFLite-0.1.32.tar.gz",
"date": "2014-05-07T22:03:00",
"sha1": "3289269f75b4111dd00eaea53e00330db9a1db12",
"size": 46644,
"sha256": "911497d655cf7ef6530c5b57773dad7da97e21cf4d608ad9ad1e38bd7bec7824",
"filename": "PyPDFLite-0.1.32.tar.gz",
"sha1_git": "1e5c38014731242cfa8594839bcba8a0c4e158c5",
"blake2s256": "45792e57873f56d385c694e36c98a580cbba60d5ea91eb6fd0a2d1c71c1fb385",
"archive_type": "tar",
}
dest_original_artifacts = [
{
"url": "https://files.pythonhosted.org/packages/34/4f/30087f22eaae8ad7077a28ce157342745a2977e264b8a8e4e7f804a8aa5e/PyPDFLite-0.1.32.tar.gz",
"filename": "PyPDFLite-0.1.32.tar.gz",
"archive_type": "tar",
"length": 46644,
"checksums": {
"sha1": "3289269f75b4111dd00eaea53e00330db9a1db12",
"sha256": "911497d655cf7ef6530c5b57773dad7da97e21cf4d608ad9ad1e38bd7bec7824",
"sha1_git": "1e5c38014731242cfa8594839bcba8a0c4e158c5",
"blake2s256": "45792e57873f56d385c694e36c98a580cbba60d5ea91eb6fd0a2d1c71c1fb385",
},
}
]
row = {
"id": b"N\xa9\x91|\xdfS\xcd\x13SJ\x04.N\xb3x{\x86\xc84\xd2",
"directory": DIRECTORY_ID,
"date": datetime.datetime(2014, 5, 7, 22, 3, tzinfo=datetime.timezone.utc),
"committer_date": datetime.datetime(
2014, 5, 7, 22, 3, tzinfo=datetime.timezone.utc
),
"type": "tar",
"message": b"0.1.32",
"metadata": {"original_artifact": source_original_artifact},
}
origin_url = "https://pypi.org/project/PyPDFLite/"
storage = get_storage("memory")
> storage.origin_add([Origin(url=origin_url)])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/migrate_extrinsic_metadata/test_pypi.py:502:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f384d990550>
origins = [Origin(url='https://pypi.org/project/PyPDFLite/')]
def origin_add(self, origins: List[Origin]) -> Dict[str, int]:
> if not self._allow_overwrite:
E AttributeError: 'InMemoryStorage' object has no attribute '_allow_overwrite'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:940: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 10:23 AM