swh_config = '/tmp/pytest-of-jenkins/pytest-0/test_multiple_visits_with_no_c0/loader.yml'
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7f4435c5e240>
def test_multiple_visits_with_no_change(swh_config, requests_mock_datadir):
"""Multiple visits with no changes results in 1 same snapshot
"""
url = "https://pypi.org/project/0805nexter"
loader = PyPILoader(url)
actual_load_status = loader.load()
snapshot_id = "ba6e158ada75d0b3cfb209ffdf6daa4ed34a227a"
assert actual_load_status == {
"status": "eventful",
"snapshot_id": snapshot_id,
}
assert_last_visit_matches(loader.storage, url, status="full", type="pypi")
stats = get_stats(loader.storage)
assert {
"content": 6,
"directory": 4,
"origin": 1,
"origin_visit": 1,
"person": 1,
"release": 0,
"revision": 2,
"skipped_content": 0,
"snapshot": 1,
} == stats
expected_branches = {
"releases/1.1.0": {
"target": "4c99891f93b81450385777235a37b5e966dd1571",
"target_type": "revision",
},
"releases/1.2.0": {
"target": "e445da4da22b31bfebb6ffc4383dbf839a074d21",
"target_type": "revision",
},
"HEAD": {"target": "releases/1.2.0", "target_type": "alias",},
}
expected_snapshot = {
"id": snapshot_id,
"branches": expected_branches,
}
check_snapshot(expected_snapshot, loader.storage)
actual_load_status2 = loader.load()
> assert actual_load_status2 == {
"status": "uneventful",
"snapshot_id": actual_load_status2["snapshot_id"],
}
E AssertionError: assert {'snapshot_id...': 'eventful'} == {'snapshot_id... 'uneventful'}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'status': 'eventful'} != {'status': 'uneventful'}
E Full diff:
E {
E 'snapshot_id': 'ba6e158ada75d0b3cfb209ffdf6daa4ed34a227a',
E - 'status': 'uneventful',...
E
E ...Full output truncated (4 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/loader/package/pypi/tests/test_pypi.py:525: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jun 22 2020, 4:49 PM