Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/debian/tests/test_debian.py
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | assert { | ||||
"person": 1, | "person": 1, | ||||
"release": 0, | "release": 0, | ||||
"revision": 1, # all artifacts under 1 revision | "revision": 1, # all artifacts under 1 revision | ||||
"skipped_content": 0, | "skipped_content": 0, | ||||
"snapshot": 1, | "snapshot": 1, | ||||
} == stats | } == stats | ||||
expected_snapshot = { | expected_snapshot = { | ||||
"id": expected_snapshot_id, | "id": hash_to_bytes(expected_snapshot_id), | ||||
"branches": { | "branches": { | ||||
b"releases/stretch/contrib/0.7.2-3": { | b"releases/stretch/contrib/0.7.2-3": { | ||||
"target_type": "revision", | "target_type": "revision", | ||||
"target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"), | "target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"), | ||||
} | } | ||||
}, | }, | ||||
} # different than the previous loader as no release is done | } # different than the previous loader as no release is done | ||||
Show All 28 Lines | assert { | ||||
"person": 1, | "person": 1, | ||||
"release": 0, | "release": 0, | ||||
"revision": 1, # all artifacts under 1 revision | "revision": 1, # all artifacts under 1 revision | ||||
"skipped_content": 0, | "skipped_content": 0, | ||||
"snapshot": 1, | "snapshot": 1, | ||||
} == stats | } == stats | ||||
expected_snapshot = { | expected_snapshot = { | ||||
"id": expected_snapshot_id, | "id": hash_to_bytes(expected_snapshot_id), | ||||
"branches": { | "branches": { | ||||
b"releases/stretch/contrib/0.7.2-3": { | b"releases/stretch/contrib/0.7.2-3": { | ||||
"target_type": "revision", | "target_type": "revision", | ||||
"target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"), | "target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"), | ||||
} | } | ||||
}, | }, | ||||
} # different than the previous loader as no release is done | } # different than the previous loader as no release is done | ||||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | def test_debian_multiple_packages(swh_config, requests_mock_datadir): | ||||
assert actual_load_status == { | assert actual_load_status == { | ||||
"status": "eventful", | "status": "eventful", | ||||
"snapshot_id": expected_snapshot_id, | "snapshot_id": expected_snapshot_id, | ||||
} | } | ||||
assert_last_visit_matches(loader.storage, url, status="full", type="deb") | assert_last_visit_matches(loader.storage, url, status="full", type="deb") | ||||
expected_snapshot = { | expected_snapshot = { | ||||
"id": expected_snapshot_id, | "id": hash_to_bytes(expected_snapshot_id), | ||||
"branches": { | "branches": { | ||||
b"releases/stretch/contrib/0.7.2-3": { | b"releases/stretch/contrib/0.7.2-3": { | ||||
"target_type": "revision", | "target_type": "revision", | ||||
"target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"), | "target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"), | ||||
}, | }, | ||||
b"releases/buster/contrib/0.7.2-4": { | b"releases/buster/contrib/0.7.2-4": { | ||||
"target_type": "revision", | "target_type": "revision", | ||||
"target": hash_to_bytes("8224139c274c984147ef4b09aa0e462c55a10bd3"), | "target": hash_to_bytes("8224139c274c984147ef4b09aa0e462c55a10bd3"), | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |