Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/deposit/tests/test_deposit.py
Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | def test_deposit_loading_ok(swh_config, requests_mock_datadir): | ||||
} == stats | } == stats | ||||
revision_id = "637318680351f5d78856d13264faebbd91efe9bb" | revision_id = "637318680351f5d78856d13264faebbd91efe9bb" | ||||
expected_branches = { | expected_branches = { | ||||
b"HEAD": {"target": hash_to_bytes(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": hash_to_bytes(expected_snapshot_id), | ||||
"branches": expected_branches, | "branches": expected_branches, | ||||
} | } | ||||
check_snapshot(expected_snapshot, storage=loader.storage) | check_snapshot(expected_snapshot, storage=loader.storage) | ||||
revision = next(loader.storage.revision_get([hash_to_bytes(revision_id)])) | revision = next(loader.storage.revision_get([hash_to_bytes(revision_id)])) | ||||
assert revision | assert revision | ||||
# check metadata | # check metadata | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | def test_deposit_loading_ok_2(swh_config, requests_mock_datadir): | ||||
} | } | ||||
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 = { | expected_branches = { | ||||
b"HEAD": {"target": hash_to_bytes(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": hash_to_bytes(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) | ||||
# Ensure the date fields are set appropriately in the revision | # Ensure the date fields are set appropriately in the revision | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |