Page MenuHomeSoftware Heritage

D3241.diff
No OneTemporary

D3241.diff

diff --git a/swh/journal/serializers.py b/swh/journal/serializers.py
--- a/swh/journal/serializers.py
+++ b/swh/journal/serializers.py
@@ -62,6 +62,12 @@
"origin": object_.origin,
"date": str(object_.date),
}
+ elif object_type == "origin_visit_status":
+ return {
+ "origin": object_.origin,
+ "visit": str(object_.visit),
+ "date": str(object_.date),
+ }
else:
raise ValueError("Unknown object type: %s." % object_type)
diff --git a/swh/journal/tests/journal_data.py b/swh/journal/tests/journal_data.py
--- a/swh/journal/tests/journal_data.py
+++ b/swh/journal/tests/journal_data.py
@@ -3,6 +3,7 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
+import copy
import datetime
from typing import Any, Dict, List, Type
@@ -16,6 +17,7 @@
Directory,
Origin,
OriginVisit,
+ OriginVisitStatus,
Release,
Revision,
SkippedContent,
@@ -28,6 +30,7 @@
Directory: "directory",
Origin: "origin",
OriginVisit: "origin_visit",
+ OriginVisitStatus: "origin_visit_status",
Release: "release",
Revision: "revision",
SkippedContent: "skipped_content",
@@ -191,6 +194,13 @@
]
+ORIGIN_VISIT_STATUSES = []
+for visit in ORIGIN_VISITS:
+ visit_status = copy.deepcopy(visit)
+ visit_status.pop("type")
+ ORIGIN_VISIT_STATUSES.append(visit_status)
+
+
DIRECTORIES = [
{"id": hash_to_bytes("4b825dc642cb6eb9a060e54bf8d69288fbee4904"), "entries": ()},
{
@@ -253,6 +263,7 @@
"directory": DIRECTORIES,
"origin": ORIGINS,
"origin_visit": ORIGIN_VISITS,
+ "origin_visit_status": ORIGIN_VISIT_STATUSES,
"release": RELEASES,
"revision": REVISIONS,
"snapshot": SNAPSHOTS,
diff --git a/swh/journal/tests/test_pytest_plugin.py b/swh/journal/tests/test_pytest_plugin.py
--- a/swh/journal/tests/test_pytest_plugin.py
+++ b/swh/journal/tests/test_pytest_plugin.py
@@ -56,6 +56,7 @@
"directory",
"origin",
"origin_visit",
+ "origin_visit_status",
"release",
"revision",
"snapshot",

File Metadata

Mime Type
text/plain
Expires
Sun, Aug 17, 7:51 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3214217

Event Timeline