Skip to content

Commit

Permalink
Adds more tests for reconciling DOIs (#83)
Browse files Browse the repository at this point in the history
* Added tests from a difficult reconcile

* pre-commit

* Pre-commit
  • Loading branch information
blackadad authored Apr 12, 2024
1 parent e997efd commit 5451bdd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_paperscraper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import contextlib
import os
Expand Down Expand Up @@ -82,6 +84,26 @@ async def test_reconcile_dois(self) -> None:
key = bibtex.split("{")[1].split(",")[0]
assert format_bibtex(bibtex, key, clean=False)

async def test_hard_reconciles(self):
test_parameters: list[dict] = [
{
"title": "High-throughput screening of human genetic variants by pooled prime editing.", # noqa: E501
"doi": "10.1101/2024.04.01.587366",
},
{
"title": "High-throughput screening of human genetic variants by pooled prime editing.", # noqa: E501
"authors": ["garbage", "authors", "that"],
"doi": "10.1101/2024.04.01.587366",
},
{
"title": "High throughput screening of human genetic variants by pooled prime editing", # noqa: E501
"doi": "10.1101/2024.04.01.587366",
},
]
session = ThrottledClientSession(headers=get_header(), rate_limit=15 / 60)
for test in test_parameters:
assert await reconcile_doi(test["title"], [], session) == test["doi"]


def test_find_doi() -> None:
test_parameters = [
Expand Down

0 comments on commit 5451bdd

Please sign in to comment.