Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/deposit/tests/test_deposit.py
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | assert { | ||||
"release": 0, | "release": 0, | ||||
"revision": 1, | "revision": 1, | ||||
"skipped_content": 0, | "skipped_content": 0, | ||||
"snapshot": 1, | "snapshot": 1, | ||||
} == stats | } == stats | ||||
revision_id = "637318680351f5d78856d13264faebbd91efe9bb" | revision_id = "637318680351f5d78856d13264faebbd91efe9bb" | ||||
expected_branches = { | expected_branches = { | ||||
"HEAD": {"target": revision_id, "target_type": "revision",}, | b"HEAD": {"target": hash_to_bytes(revision_id), "target_type": "revision",}, | ||||
} | } | ||||
expected_snapshot = { | expected_snapshot = { | ||||
"id": expected_snapshot_id, | "id": expected_snapshot_id, | ||||
"branches": expected_branches, | "branches": expected_branches, | ||||
} | } | ||||
check_snapshot(expected_snapshot, storage=loader.storage) | check_snapshot(expected_snapshot, storage=loader.storage) | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | def test_deposit_loading_ok_2(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="deposit") | assert_last_visit_matches(loader.storage, url, status="full", type="deposit") | ||||
revision_id = "564d18943d71be80d0d73b43a77cfb205bcde96c" | revision_id = "564d18943d71be80d0d73b43a77cfb205bcde96c" | ||||
expected_branches = {"HEAD": {"target": revision_id, "target_type": "revision"}} | expected_branches = { | ||||
b"HEAD": {"target": hash_to_bytes(revision_id), "target_type": "revision"} | |||||
} | |||||
expected_snapshot = { | expected_snapshot = { | ||||
"id": expected_snapshot_id, | "id": expected_snapshot_id, | ||||
"branches": expected_branches, | "branches": expected_branches, | ||||
} | } | ||||
check_snapshot(expected_snapshot, storage=loader.storage) | check_snapshot(expected_snapshot, storage=loader.storage) | ||||
raw_meta = loader.client.metadata_get(deposit_id) | raw_meta = loader.client.metadata_get(deposit_id) | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |