(self)
| 641 | class TestIdentifierDataCite: |
| 642 | |
| 643 | def test_success(self): |
| 644 | ident = IdentifierModule() |
| 645 | payload = {"data": {"attributes": { |
| 646 | "titles": [{"title": "My Dataset"}], |
| 647 | "creators": [{"name": "Doe, Jane"}], |
| 648 | "publicationYear": 2022, "publisher": "Zenodo", |
| 649 | "url": "https://doi.org/10.1234/data", |
| 650 | "types": {"resourceTypeGeneral": "Dataset"}, |
| 651 | }}} |
| 652 | |
| 653 | with patch("onecite.pipeline.requests.get", |
| 654 | return_value=DummyResponse(json_data=payload)): |
| 655 | r = ident._query_datacite("10.1234/data") |
| 656 | |
| 657 | assert r["title"] == "My Dataset" |
| 658 | assert r["source"] == "datacite" |
| 659 | assert r["year"] == 2022 |
| 660 | assert "Doe, Jane" in r["authors"] |
| 661 | |
| 662 | def test_404_returns_none(self): |
| 663 | ident = IdentifierModule() |
nothing calls this directly
no test coverage detected