Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123970
D3536.id12479.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D3536.id12479.diff
View Options
diff --git a/swh/loader/package/debian/tests/test_debian.py b/swh/loader/package/debian/tests/test_debian.py
--- a/swh/loader/package/debian/tests/test_debian.py
+++ b/swh/loader/package/debian/tests/test_debian.py
@@ -28,7 +28,7 @@
from swh.loader.package.debian.loader import resolve_revision_from
from swh.model.hashutil import hash_to_bytes
-from swh.model.model import Person
+from swh.model.model import Person, Snapshot, SnapshotBranch, TargetType
logger = logging.getLogger(__name__)
@@ -133,15 +133,15 @@
"snapshot": 1,
} == stats
- expected_snapshot = {
- "id": hash_to_bytes(expected_snapshot_id),
- "branches": {
- b"releases/stretch/contrib/0.7.2-3": {
- "target_type": "revision",
- "target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"),
- }
+ expected_snapshot = Snapshot(
+ id=hash_to_bytes(expected_snapshot_id),
+ branches={
+ b"releases/stretch/contrib/0.7.2-3": SnapshotBranch(
+ target_type=TargetType.REVISION,
+ 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
check_snapshot(expected_snapshot, loader.storage)
@@ -178,15 +178,15 @@
"snapshot": 1,
} == stats
- expected_snapshot = {
- "id": hash_to_bytes(expected_snapshot_id),
- "branches": {
- b"releases/stretch/contrib/0.7.2-3": {
- "target_type": "revision",
- "target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"),
- }
+ expected_snapshot = Snapshot(
+ id=hash_to_bytes(expected_snapshot_id),
+ branches={
+ b"releases/stretch/contrib/0.7.2-3": SnapshotBranch(
+ target_type=TargetType.REVISION,
+ 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
check_snapshot(expected_snapshot, loader.storage)
@@ -380,19 +380,19 @@
assert_last_visit_matches(loader.storage, url, status="full", type="deb")
- expected_snapshot = {
- "id": hash_to_bytes(expected_snapshot_id),
- "branches": {
- b"releases/stretch/contrib/0.7.2-3": {
- "target_type": "revision",
- "target": hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"),
- },
- b"releases/buster/contrib/0.7.2-4": {
- "target_type": "revision",
- "target": hash_to_bytes("8224139c274c984147ef4b09aa0e462c55a10bd3"),
- },
+ expected_snapshot = Snapshot(
+ id=hash_to_bytes(expected_snapshot_id),
+ branches={
+ b"releases/stretch/contrib/0.7.2-3": SnapshotBranch(
+ target_type=TargetType.REVISION,
+ target=hash_to_bytes("2807f5b3f84368b4889a9ae827fe85854ffecf07"),
+ ),
+ b"releases/buster/contrib/0.7.2-4": SnapshotBranch(
+ target_type=TargetType.REVISION,
+ target=hash_to_bytes("8224139c274c984147ef4b09aa0e462c55a10bd3"),
+ ),
},
- }
+ )
check_snapshot(expected_snapshot, loader.storage)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 20 2024, 7:28 AM (11 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221953
Attached To
D3536: test_debian: Check against snapshot model object
Event Timeline
Log In to Comment