mocker = <pytest_mock.plugin.MockerFixture object at 0x7fb613dee438>
def test_pypi_2(mocker):
"""Tests loading a revision generated by an old PyPI loader that
does not have a provider, but has 'project' metadata."""
mocker.patch(
"swh.storage.migrate_extrinsic_metadata.urlopen",
side_effect=urllib.error.HTTPError(None, 404, "Not Found", None, None),
)
extrinsic_metadata = {
"name": "jupyterhub-simx",
"author": "Jupyter Development Team",
"license": "BSD",
"summary": "JupyterHub: A multi-user server for Jupyter notebooks",
"version": "1.0.5",
# ...
}
source_original_artifacts = [
{
"url": "https://files.pythonhosted.org/packages/72/28/a8098763d78e2c4607cb67602c0d726a97ac38d4c1f531aac28f49de2e1a/jupyterhub-simx-1.0.5.tar.gz",
"date": "2019-01-23T22:10:55",
"sha1": "ede3eadd5a06e70912e3ba7cfccef789c4ad3168",
"size": 2346538,
"sha256": "0399d7f5f0d90c525d369f0507ad0e8ef8729c1c7fa63aadfc46a27514d14a46",
"filename": "jupyterhub-simx-1.0.5.tar.gz",
"sha1_git": "734301124712182eb30fc90e97cc18cef5432f02",
"blake2s256": "bb4aa82ffb5891a05dcf6d4dce3ad56fd2c18e9abdba9d20972910649d869322",
"archive_type": "tar",
}
]
dest_original_artifacts = [
{
"url": "https://files.pythonhosted.org/packages/72/28/a8098763d78e2c4607cb67602c0d726a97ac38d4c1f531aac28f49de2e1a/jupyterhub-simx-1.0.5.tar.gz",
"filename": "jupyterhub-simx-1.0.5.tar.gz",
"archive_type": "tar",
"length": 2346538,
"checksums": {
"sha1": "ede3eadd5a06e70912e3ba7cfccef789c4ad3168",
"sha256": "0399d7f5f0d90c525d369f0507ad0e8ef8729c1c7fa63aadfc46a27514d14a46",
"sha1_git": "734301124712182eb30fc90e97cc18cef5432f02",
"blake2s256": "bb4aa82ffb5891a05dcf6d4dce3ad56fd2c18e9abdba9d20972910649d869322",
},
}
]
row = {
"id": b"\x00\x00\x04\xd68,J\xd4\xc0Q\x92fbl6U\x1f\x0eQ\xca",
"directory": DIRECTORY_ID,
"date": datetime.datetime(
2019, 1, 23, 22, 10, 55, tzinfo=datetime.timezone.utc
),
"committer_date": datetime.datetime(
2019, 1, 23, 22, 10, 55, tzinfo=datetime.timezone.utc
),
"type": "tar",
"message": b"1.0.5",
"metadata": {
"project": extrinsic_metadata,
"original_artifact": source_original_artifacts,
},
}
origin_url = "https://pypi.org/project/jupyterhub-simx/"
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:395:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7fb6113e3588>
origins = [Origin(url='https://pypi.org/project/jupyterhub-simx/')]
def origin_add(self, origins: List[Origin]) -> Dict[str, int]:
> if self._check_missing:
E AttributeError: 'InMemoryStorage' object has no attribute '_check_missing'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:937: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 22 2021, 8:33 PM