Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/tests/api/test_deposit_private_read_metadata.py
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | for url in private_get_raw_url_endpoints(deposit_collection, deposit): | ||||
expected_meta = { | expected_meta = { | ||||
"origin": { | "origin": { | ||||
"type": "deposit", | "type": "deposit", | ||||
"url": "https://hal-test.archives-ouvertes.fr/some-external-id", | "url": "https://hal-test.archives-ouvertes.fr/some-external-id", | ||||
}, | }, | ||||
"origin_metadata": { | "origin_metadata": { | ||||
"metadata": { | "metadata": { | ||||
"@xmlns": ["http://www.w3.org/2005/Atom"], | |||||
"author": ["some awesome author", "another one", "no one"], | "author": ["some awesome author", "another one", "no one"], | ||||
"codemeta:dateCreated": "2017-10-07T15:17:08Z", | "codemeta:dateCreated": "2017-10-07T15:17:08Z", | ||||
"external_identifier": "some-external-id", | "external_identifier": "some-external-id", | ||||
"url": "https://hal-test.archives-ouvertes.fr/some-external-id", # noqa | "url": "https://hal-test.archives-ouvertes.fr/some-external-id", # noqa | ||||
}, | }, | ||||
"provider": { | "provider": { | ||||
"metadata": {}, | "metadata": {}, | ||||
"provider_name": "", | "provider_name": "", | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | for url in private_get_raw_url_endpoints(deposit_collection, deposit): | ||||
expected_meta = { | expected_meta = { | ||||
"origin": { | "origin": { | ||||
"type": "deposit", | "type": "deposit", | ||||
"url": "https://hal-test.archives-ouvertes.fr/some-external-id", | "url": "https://hal-test.archives-ouvertes.fr/some-external-id", | ||||
}, | }, | ||||
"origin_metadata": { | "origin_metadata": { | ||||
"metadata": { | "metadata": { | ||||
"@xmlns": ["http://www.w3.org/2005/Atom"], | |||||
"author": ["some awesome author", "another one", "no one"], | "author": ["some awesome author", "another one", "no one"], | ||||
"codemeta:dateCreated": "2017-10-07T15:17:08Z", | "codemeta:dateCreated": "2017-10-07T15:17:08Z", | ||||
"external_identifier": "some-external-id", | "external_identifier": "some-external-id", | ||||
"url": "https://hal-test.archives-ouvertes.fr/some-external-id", # noqa | "url": "https://hal-test.archives-ouvertes.fr/some-external-id", # noqa | ||||
}, | }, | ||||
"provider": { | "provider": { | ||||
"metadata": {}, | "metadata": {}, | ||||
"provider_name": "", | "provider_name": "", | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | """ | ||||
for url in private_get_raw_url_endpoints(deposit_collection, deposit): | for url in private_get_raw_url_endpoints(deposit_collection, deposit): | ||||
response = authenticated_client.get(url) | response = authenticated_client.get(url) | ||||
assert response.status_code == status.HTTP_200_OK | assert response.status_code == status.HTTP_200_OK | ||||
assert response._headers["content-type"][1] == "application/json" | assert response._headers["content-type"][1] == "application/json" | ||||
data = response.json() | data = response.json() | ||||
metadata = { | metadata = { | ||||
"@xmlns": ["http://www.w3.org/2005/Atom"], | |||||
"@xmlns:codemeta": "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0", | |||||
"author": [ | "author": [ | ||||
"some awesome author", | "some awesome author", | ||||
"another one", | "another one", | ||||
"no one", | "no one", | ||||
{"email": "hal@ccsd.cnrs.fr", "name": "HAL"}, | {"email": "hal@ccsd.cnrs.fr", "name": "HAL"}, | ||||
], | ], | ||||
"client": "hal", | "client": "hal", | ||||
"codemeta:applicationCategory": "test", | "codemeta:applicationCategory": "test", | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | ): | ||||
for url in private_get_raw_url_endpoints(deposit_collection, deposit): | for url in private_get_raw_url_endpoints(deposit_collection, deposit): | ||||
response = authenticated_client.get(url) | response = authenticated_client.get(url) | ||||
assert response.status_code == status.HTTP_200_OK | assert response.status_code == status.HTTP_200_OK | ||||
assert response._headers["content-type"][1] == "application/json" | assert response._headers["content-type"][1] == "application/json" | ||||
data = response.json() | data = response.json() | ||||
metadata = { | metadata = { | ||||
"@xmlns": "http://www.w3.org/2005/Atom", | |||||
"@xmlns:codemeta": "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0", | |||||
"author": {"email": "hal@ccsd.cnrs.fr", "name": "HAL"}, | "author": {"email": "hal@ccsd.cnrs.fr", "name": "HAL"}, | ||||
"client": "hal", | "client": "hal", | ||||
"codemeta:applicationCategory": "test", | "codemeta:applicationCategory": "test", | ||||
"codemeta:author": {"codemeta:name": "Morane Gruenpeter"}, | "codemeta:author": {"codemeta:name": "Morane Gruenpeter"}, | ||||
"codemeta:description": "this is the description", | "codemeta:description": "this is the description", | ||||
"codemeta:developmentStatus": "stable", | "codemeta:developmentStatus": "stable", | ||||
"codemeta:keywords": "DSP programming", | "codemeta:keywords": "DSP programming", | ||||
"codemeta:license": [ | "codemeta:license": [ | ||||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | for url in private_get_raw_url_endpoints(deposit_collection, deposit): | ||||
data = response.json() | data = response.json() | ||||
expected_origin = { | expected_origin = { | ||||
"type": "deposit", | "type": "deposit", | ||||
"url": "https://hal-test.archives-ouvertes.fr/external-id-partial", | "url": "https://hal-test.archives-ouvertes.fr/external-id-partial", | ||||
} | } | ||||
metadata = { | metadata = { | ||||
"@xmlns": "http://www.w3.org/2005/Atom", | |||||
"@xmlns:codemeta": "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0", | |||||
"author": {"email": "hal@ccsd.cnrs.fr", "name": "HAL"}, | "author": {"email": "hal@ccsd.cnrs.fr", "name": "HAL"}, | ||||
"client": "hal", | "client": "hal", | ||||
"codemeta:applicationCategory": "test", | "codemeta:applicationCategory": "test", | ||||
"codemeta:author": {"codemeta:name": "Morane Gruenpeter"}, | "codemeta:author": {"codemeta:name": "Morane Gruenpeter"}, | ||||
"codemeta:dateCreated": [ | "codemeta:dateCreated": [ | ||||
"2015-04-06T17:08:47+02:00", | "2015-04-06T17:08:47+02:00", | ||||
"2016-04-06T17:08:47+02:00", | "2016-04-06T17:08:47+02:00", | ||||
], | ], | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |