Page MenuHomeSoftware Heritage

D5755.diff
No OneTemporary

D5755.diff

diff --git a/swh/model/tests/swh_model_data.py b/swh/model/tests/swh_model_data.py
--- a/swh/model/tests/swh_model_data.py
+++ b/swh/model/tests/swh_model_data.py
@@ -243,7 +243,7 @@
visit=3,
type="git",
status="full",
- snapshot=hash_to_bytes("17d0066a4a80aba4a0e913532ee8ff2014f006a9"),
+ snapshot=hash_to_bytes("9e78d7105c5e0f886487511e2a92377b4ee4c32a"),
metadata=None,
),
OriginVisitStatus(
@@ -252,7 +252,7 @@
visit=2,
type="hg",
status="partial",
- snapshot=hash_to_bytes("8ce268b87faf03850693673c3eb5c9bb66e1ca38"),
+ snapshot=hash_to_bytes("0e7f84ede9a254f2cd55649ad5240783f557e65f"),
metadata=None,
),
]
@@ -293,7 +293,7 @@
},
),
Snapshot(
- id=hash_to_bytes("09efffaaad8d1f9c7f9402db0266dbe28082853f"),
+ id=hash_to_bytes("0e7f84ede9a254f2cd55649ad5240783f557e65f"),
branches={
b"target/revision": SnapshotBranch(
target_type=TargetType.REVISION, target=REVISIONS[0].id,
@@ -309,7 +309,7 @@
),
b"target/snapshot": SnapshotBranch(
target_type=TargetType.SNAPSHOT,
- target=hash_to_bytes("17d0066a4a80aba4a0e913532ee8ff2014f006a9"),
+ target=hash_to_bytes("9e78d7105c5e0f886487511e2a92377b4ee4c32a"),
),
},
),
diff --git a/swh/model/tests/test_swh_model_data.py b/swh/model/tests/test_swh_model_data.py
--- a/swh/model/tests/test_swh_model_data.py
+++ b/swh/model/tests/test_swh_model_data.py
@@ -28,7 +28,7 @@
), f"{obj.compute_hash().hex()} != {obj.id.hex()}"
-def test_ensure_visit_visit_status_date_consistency():
+def test_ensure_visit_status_date_consistency():
"""ensure origin-visit-status dates are more recent than their visit counterpart
The origin-visit-status dates needs to be shifted slightly in the future from their
@@ -43,3 +43,12 @@
assert visit.origin == visit_status.origin
assert visit.visit == visit_status.visit
assert visit.date < visit_status.date
+
+
+def test_ensure_visit_status_snapshot_consistency():
+ """ensure origin-visit-status snapshots exist in the test dataset
+ """
+ snapshots = [snp.id for snp in TEST_OBJECTS["snapshot"]]
+ for visit_status in TEST_OBJECTS["origin_visit_status"]:
+ if visit_status.snapshot:
+ assert visit_status.snapshot in snapshots

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 3:47 PM (12 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225944

Event Timeline