Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def map_value(self, src_record, ctx, logger):
"scheme": "inspire",
"identifier": ctx.inspire_id,
"relation_type": {"id": "isvariantformof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": ctx.resource_type.value},
}
)

Expand Down
2 changes: 1 addition & 1 deletion site/tests/inspire_harvester/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def transformed_record_no_files():
"identifier": "1695540",
"scheme": "inspire",
"relation_type": {"id": "isversionof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": "publication-dissertation"},
}
],
},
Expand Down
12 changes: 6 additions & 6 deletions site/tests/inspire_harvester/test_harvester_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
},
},
"resource_type": {
"id": "publication-other",
"id": "publication-dissertation",
"title": {
"de": "Abschlussarbeit",
"en": "Other",
"en": "Thesis",
},
},
"scheme": "inspire",
Expand Down Expand Up @@ -196,10 +196,10 @@
},
},
"resource_type": {
"id": "publication-other",
"id": "publication-dissertation",
"title": {
"de": "Abschlussarbeit",
"en": "Other",
"en": "Thesis",
},
},
"scheme": "inspire",
Expand Down Expand Up @@ -275,10 +275,10 @@
},
},
"resource_type": {
"id": "publication-other",
"id": "publication-dissertation",
"title": {
"de": "Abschlussarbeit",
"en": "Other",
"en": "Thesis",
},
},
"scheme": "inspire",
Expand Down
2 changes: 1 addition & 1 deletion site/tests/inspire_harvester/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_transform_related_identifiers(mock_normalize_isbn, running_app):
"identifier": "12345",
"scheme": "inspire",
"relation_type": {"id": "isvariantformof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": "other"},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this just other now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this test creates the context with resource_type=ResourceType.OTHER at L59. In site/cds_rdm/inspire_harvester/transform/resource_types.py, ResourceType.OTHER is explicitly defined as "other", so this assertion is validating the new intended behavior.

Image

} in result
assert {
"identifier": "978-0-123456-78-9",
Expand Down
10 changes: 2 additions & 8 deletions site/tests/inspire_harvester/test_update_create_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ def test_new_non_CDS_record(
"en": "is variant of",
},
},
"resource_type": {
"id": "publication-other",
"title": {
"de": "Abschlussarbeit",
"en": "Other",
},
},
"resource_type": created_record["metadata"]["resource_type"],
}
]
assert created_record["metadata"]["identifiers"] == [
Expand Down Expand Up @@ -147,7 +141,7 @@ def test_update_record_with_CDS_DOI_one_doc_type(
"identifier": "2707794",
"scheme": "inspire",
"relation_type": {"id": "isvariantformof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": "publication-preprint"},
} in new_version.data["metadata"]["related_identifiers"]

# clean up for other tests
Expand Down
6 changes: 3 additions & 3 deletions site/tests/inspire_harvester/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def transformed_record_1_file(scope="function"):
"identifier": "2685275",
"scheme": "inspire",
"relation_type": {"id": "isversionof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": "publication-dissertation"},
}
],
},
Expand Down Expand Up @@ -85,7 +85,7 @@ def transformed_record_2_files():
"identifier": "2685275",
"scheme": "inspire",
"relation_type": {"id": "isversionof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": "publication-dissertation"},
}
],
},
Expand Down Expand Up @@ -208,7 +208,7 @@ def test_writer_2_records(
"identifier": "1793973",
"scheme": "inspire",
"relation_type": {"id": "isversionof"},
"resource_type": {"id": "publication-other"},
"resource_type": {"id": "publication-dissertation"},
}
],
},
Expand Down
Loading