swh_storage = <swh.storage.proxies.retry.RetryingProxyStorage object at 0x7ffaa70d52e8>
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7ffaa7110cc0>
def test_cran_2_visits_same_origin(swh_storage, requests_mock_datadir):
"""Multiple visits on the same origin, only 1 archive fetch"""
version = "2.22-6"
base_url = "https://cran.r-project.org"
origin_url = f"{base_url}/Packages/Recommended_KernSmooth/index.html"
artifact_url = (
f"{base_url}/src_contrib_1.4.0_Recommended_KernSmooth_{version}.tar.gz" # noqa
)
loader = CRANLoader(
swh_storage, origin_url, artifacts=[{"url": artifact_url, "version": version}]
)
# first visit
actual_load_status = loader.load()
expected_snapshot_id = "920adcccc78aaeedd3cfa4459dd900d8c3431a21"
> assert actual_load_status == {
"status": "eventful",
"snapshot_id": SNAPSHOT.id.hex(),
}
E AssertionError: assert {'snapshot_id... 'uneventful'} == {'snapshot_id...': 'eventful'}
E Differing items:
E {'status': 'uneventful'} != {'status': 'eventful'}
E {'snapshot_id': '1a8893e6a86f444e8be8e7bda6cb34fb1735a00e'} != {'snapshot_id': '920adcccc78aaeedd3cfa4459dd900d8c3431a21'}
E Full diff:
E {
E - 'snapshot_id': '920adcccc78aaeedd3cfa4459dd900d8c3431a21',
E + 'snapshot_id': '1a8893e6a86f444e8be8e7bda6cb34fb1735a00e',...
E
E ...Full output truncated (5 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/loader/package/cran/tests/test_cran.py:226: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Aug 12 2021, 12:13 PM