Skip to content

Commit

Permalink
fix[data builder]: Access doi value directly in literature
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Vagliano
  • Loading branch information
Lorenzovagliano committed Jan 13, 2025
1 parent 0afd2ac commit 3db8ae7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inspire_schemas/builders/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,6 @@ def add_literature(self, doi=None, record=None):
}

if doi:
literature_dict['doi'] = doi
literature_dict['doi']["value"] = doi

self._append_to('literature', literature_dict)
5 changes: 4 additions & 1 deletion tests/unit/test_data_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def test_add_accelerator_experiment():
def test_add_literature():
builder = DataBuilder()

doi = "10.1234/example.doi"
doi = {
"source": "amet Ut",
"value": "10.912/W/K[Bz",
}
record = {"$ref": "http://example.com/api/literature/123"}

builder.add_literature(doi, record=record)
Expand Down

0 comments on commit 3db8ae7

Please sign in to comment.