Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123854
D3543.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D3543.diff
View Options
diff --git a/swh/loader/package/nixguix/tests/test_nixguix.py b/swh/loader/package/nixguix/tests/test_nixguix.py
--- a/swh/loader/package/nixguix/tests/test_nixguix.py
+++ b/swh/loader/package/nixguix/tests/test_nixguix.py
@@ -11,7 +11,7 @@
from json.decoder import JSONDecodeError
from swh.storage.interface import StorageInterface
-from typing import Any, Dict, Iterable, Optional, Tuple, Union
+from typing import Dict, Iterable, Optional, Tuple
from unittest.mock import patch
@@ -53,7 +53,7 @@
def check_snapshot(
- snapshot: Union[Dict[str, Any], Snapshot],
+ snapshot: Snapshot,
storage: StorageInterface,
allowed_empty: Iterable[Tuple[TargetType, bytes]] = [
(TargetType.REVISION, b"evaluation")
diff --git a/swh/loader/tests/__init__.py b/swh/loader/tests/__init__.py
--- a/swh/loader/tests/__init__.py
+++ b/swh/loader/tests/__init__.py
@@ -8,7 +8,7 @@
from collections import defaultdict
from pathlib import PosixPath
-from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
+from typing import Dict, Iterable, List, Optional, Tuple, Union
from swh.model.model import OriginVisitStatus, Snapshot, TargetType
from swh.model.hashutil import hash_to_bytes
@@ -114,7 +114,7 @@
def check_snapshot(
- snapshot: Union[Dict[str, Any], Snapshot],
+ snapshot: Snapshot,
storage: StorageInterface,
allowed_empty: Iterable[Tuple[TargetType, bytes]] = [],
):
@@ -135,8 +135,6 @@
needed.
"""
- if isinstance(snapshot, dict):
- snapshot = Snapshot.from_dict(snapshot)
if not isinstance(snapshot, Snapshot):
raise AssertionError(f"variable 'snapshot' must be a snapshot: {snapshot!r}")
diff --git a/swh/loader/tests/test_init.py b/swh/loader/tests/test_init.py
--- a/swh/loader/tests/test_init.py
+++ b/swh/loader/tests/test_init.py
@@ -347,11 +347,10 @@
"snapshot:add": 1,
}
- for snap in [SNAPSHOT, SNAPSHOT.to_dict()]:
- # all should be fine!
- check_snapshot(
- snap, swh_storage, allowed_empty=[(TargetType.REVISION, b"evaluation")]
- )
+ # all should be fine!
+ check_snapshot(
+ SNAPSHOT, swh_storage, allowed_empty=[(TargetType.REVISION, b"evaluation")]
+ )
def test_check_snapshot_failures(swh_storage):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 20 2024, 4:48 AM (11 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3226074
Attached To
D3543: check_snapshot: Drop accepting using dict for snapshot comparison
Event Timeline
Log In to Comment