diff --git a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.10.json b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.10.json --- a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.10.json +++ b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.10.json @@ -41,8 +41,7 @@ "seconds": 1507389428, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "committer": { "name": "Software Heritage", @@ -54,8 +53,7 @@ "seconds": 1507389428, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "revision_parents": [], "release_notes": null diff --git a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.11.json b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.11.json --- a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.11.json +++ b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.11.json @@ -44,8 +44,7 @@ "seconds": 1507389428, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "committer": { "name": "Software Heritage", @@ -57,8 +56,7 @@ "seconds": 1507474800, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "revision_parents": [], "release_notes": null diff --git a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.12.json b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.12.json --- a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.12.json +++ b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.12.json @@ -44,8 +44,7 @@ "seconds": 1507389428, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "committer": { "name": "Software Heritage", @@ -57,8 +56,7 @@ "seconds": 1507474800, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "revision_parents": [], "release_notes": null diff --git a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.13.json b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.13.json --- a/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.13.json +++ b/swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.13.json @@ -44,8 +44,7 @@ "seconds": 1507389428, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "committer": { "name": "Software Heritage", @@ -57,8 +56,7 @@ "seconds": 1507474800, "microseconds": 0 }, - "offset": 0, - "negative_utc": false + "offset": 0 }, "revision_parents": [], "release_notes": "This release adds this and that." diff --git a/swh/loader/package/deposit/tests/test_deposit.py b/swh/loader/package/deposit/tests/test_deposit.py --- a/swh/loader/package/deposit/tests/test_deposit.py +++ b/swh/loader/package/deposit/tests/test_deposit.py @@ -330,13 +330,13 @@ # Retrieve the release release = loader.storage.release_get([hash_to_bytes(release_id)])[0] assert release - release_date_dict = release.date.to_dict() + # swh-deposit uses the numeric 'offset' instead of 'offset_bytes' because its dates + # are always well-formed, and it can only send JSON-serializable data. + release_date_dict = { + "timestamp": release.date.timestamp.to_dict(), + "offset": release.date.offset, + } - # Workaround while we migrate from storing offsets as (int, bool) to bytes. - # When the migration is done, remove this pop(). - # offset_bytes will also need to be converted to a string (which is fine because - # it is always a well-formed offset) - release_date_dict.pop("offset_bytes", None) assert release_date_dict == raw_meta["deposit"]["author_date"] assert not release.metadata