diff --git a/swh/loader/package/deposit/loader.py b/swh/loader/package/deposit/loader.py
--- a/swh/loader/package/deposit/loader.py
+++ b/swh/loader/package/deposit/loader.py
@@ -67,7 +67,7 @@
# which computes itself the values. The loader needs to use those to create the
# release.
- metadata_raw: str = metadata["metadata_raw"]
+ raw_metadata: str = metadata["raw_metadata"]
depo = metadata["deposit"]
return cls(
url=url,
@@ -84,7 +84,7 @@
directory_extrinsic_metadata=[
RawExtrinsicMetadataCore(
discovery_date=now(),
- metadata=metadata_raw.encode(),
+ metadata=raw_metadata.encode(),
format="sword-v2-atom-codemeta-v2",
)
],
@@ -208,10 +208,10 @@
def get_extrinsic_origin_metadata(self) -> List[RawExtrinsicMetadataCore]:
metadata = self.metadata()
- metadata_raw: str = metadata["metadata_raw"]
+ raw_metadata: str = metadata["raw_metadata"]
origin_metadata = json.dumps(
{
- "metadata": [metadata_raw],
+ "metadata": [raw_metadata],
"provider": metadata["provider"],
"tool": metadata["tool"],
}
@@ -219,7 +219,7 @@
return [
RawExtrinsicMetadataCore(
discovery_date=now(),
- metadata=metadata_raw.encode(),
+ metadata=raw_metadata.encode(),
format="sword-v2-atom-codemeta-v2",
),
RawExtrinsicMetadataCore(
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
@@ -3,7 +3,7 @@
"url": "https://hal-test.archives-ouvertes.fr/some-external-id",
"type": "deposit"
},
- "metadata_raw" : "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother one",
+ "raw_metadata" : "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother one",
"provider": {
"provider_name": "hal",
"provider_type": "deposit_client",
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
@@ -3,7 +3,7 @@
"url": "https://hal-test.archives-ouvertes.fr/some-external-id",
"type": "deposit"
},
- "metadata_raw": "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother oneno one",
+ "raw_metadata": "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother oneno one",
"provider": {
"provider_name": "hal",
"provider_type": "deposit_client",
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
@@ -3,7 +3,7 @@
"url": "https://hal-test.archives-ouvertes.fr/hal-123456",
"type": "deposit"
},
- "metadata_raw": "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother oneno one",
+ "raw_metadata": "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother oneno one",
"provider": {
"provider_name": "hal",
"provider_type": "deposit_client",
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
@@ -3,7 +3,7 @@
"url": "https://hal-test.archives-ouvertes.fr/hal-123456",
"type": "deposit"
},
- "metadata_raw": "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother oneno one",
+ "raw_metadata": "some-external-idhttps://hal-test.archives-ouvertes.fr/some-external-id2017-10-07T15:17:08Zsome awesome authoranother oneno one",
"provider": {
"provider_name": "hal",
"provider_type": "deposit_client",
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
@@ -229,7 +229,7 @@
)
assert orig_meta.next_page_token is None
raw_meta = loader.client.metadata_get(deposit_id)
- metadata_raw: str = raw_meta["metadata_raw"]
+ raw_metadata: str = raw_meta["raw_metadata"]
# 2 raw metadata xml + 1 json dict
assert len(orig_meta.results) == 2
orig_meta0 = orig_meta.results[0]
@@ -249,7 +249,7 @@
dir_meta = actual_dir_meta.results[0]
assert dir_meta.authority == authority
assert dir_meta.fetcher == fetcher
- assert dir_meta.metadata.decode() == metadata_raw
+ assert dir_meta.metadata.decode() == raw_metadata
# Retrieve the information for deposit status update query to the deposit
urls = [
@@ -365,7 +365,7 @@
Origin(url).swhid(), authority
)
assert origin_extrinsic_metadata.next_page_token is None
- metadata_raw: str = raw_meta["metadata_raw"]
+ raw_metadata: str = raw_meta["raw_metadata"]
# 1 raw metadata xml + 1 json dict
assert len(origin_extrinsic_metadata.results) == 2
@@ -377,7 +377,7 @@
RawExtrinsicMetadata(
target=origin_swhid,
discovery_date=origin_meta.discovery_date,
- metadata=metadata_raw.encode(),
+ metadata=raw_metadata.encode(),
format="sword-v2-atom-codemeta-v2",
authority=authority,
fetcher=fetcher,
@@ -385,7 +385,7 @@
)
origin_metadata = {
- "metadata": [metadata_raw],
+ "metadata": [raw_metadata],
"provider": provider,
"tool": tool,
}
@@ -440,7 +440,7 @@
if k != "id"
},
"discovery_date": dir_metadata.discovery_date,
- "metadata": metadata_raw.encode(),
+ "metadata": raw_metadata.encode(),
}
)
)