Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/pypi/tests/test_pypi.py
Show First 20 Lines • Show All 632 Lines • ▼ Show 20 Lines | assert { | ||||
"person": 1, | "person": 1, | ||||
"release": 0, | "release": 0, | ||||
"revision": 2, | "revision": 2, | ||||
"skipped_content": 0, | "skipped_content": 0, | ||||
"snapshot": 1, | "snapshot": 1, | ||||
} == visit1_stats | } == visit1_stats | ||||
# Reset internal state | # Reset internal state | ||||
loader._info = None | del loader._cached__raw_info | ||||
del loader._cached_info | |||||
visit2_actual_load_status = loader.load() | visit2_actual_load_status = loader.load() | ||||
visit2_stats = get_stats(loader.storage) | visit2_stats = get_stats(loader.storage) | ||||
assert visit2_actual_load_status["status"] == "eventful" | assert visit2_actual_load_status["status"] == "eventful", visit2_actual_load_status | ||||
expected_snapshot_id2 = hash_to_bytes("2e5149a7b0725d18231a37b342e9b7c4e121f283") | expected_snapshot_id2 = hash_to_bytes("2e5149a7b0725d18231a37b342e9b7c4e121f283") | ||||
assert visit2_actual_load_status == { | assert visit2_actual_load_status == { | ||||
"status": "eventful", | "status": "eventful", | ||||
"snapshot_id": expected_snapshot_id2.hex(), | "snapshot_id": expected_snapshot_id2.hex(), | ||||
} | } | ||||
assert_last_visit_matches( | assert_last_visit_matches( | ||||
loader.storage, url, status="full", type="pypi", snapshot=expected_snapshot_id2 | loader.storage, url, status="full", type="pypi", snapshot=expected_snapshot_id2 | ||||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |