(self)
| 74 | self.assertEqual(result.doi, doi) |
| 75 | |
| 76 | async def test_year_only_date(self): |
| 77 | doi = "10.1234/example.2024.001" |
| 78 | with respx.mock(assert_all_called=True) as router: |
| 79 | router.get(f"{CROSSREF_BASE_URL}/{doi}").mock( |
| 80 | return_value=httpx.Response( |
| 81 | 200, |
| 82 | json=_crossref_payload(issued={"date-parts": [[2024]]}), |
| 83 | ) |
| 84 | ) |
| 85 | result = await resolve_doi(doi) |
| 86 | assert result.published_at is not None |
| 87 | self.assertEqual(result.published_at.month, 1) |
| 88 | self.assertEqual(result.published_at.day, 1) |
| 89 | |
| 90 | async def test_missing_optional_fields(self): |
| 91 | doi = "10.1234/example.2024.001" |
nothing calls this directly
no test coverage detected