aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-10-22 20:17:06 -0700
committerBryan Newbold <bnewbold@archive.org>2020-10-22 20:17:06 -0700
commit498677bbe0a04af2ca527bdff83d02bb0710dac9 (patch)
tree56d81229be53955ca5b2d1ad28602f5f46db65bf /fatcat_scholar
parent65f880565d462950f4bcc10e77ad423d6cc3bf65 (diff)
downloadfatcat-scholar-498677bbe0a04af2ca527bdff83d02bb0710dac9.tar.gz
fatcat-scholar-498677bbe0a04af2ca527bdff83d02bb0710dac9.zip
improve test coverage
Diffstat (limited to 'fatcat_scholar')
-rw-r--r--fatcat_scholar/identifiers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/fatcat_scholar/identifiers.py b/fatcat_scholar/identifiers.py
index 2ea09c7..34e9ebb 100644
--- a/fatcat_scholar/identifiers.py
+++ b/fatcat_scholar/identifiers.py
@@ -57,6 +57,10 @@ def clean_doi(raw: Optional[str]) -> Optional[str]:
def test_clean_doi() -> None:
+ assert clean_doi(None) == None
+ assert clean_doi("") == None
+ assert clean_doi("asdf") == None
+ assert clean_doi("10.123") == None
assert clean_doi("10.1234/asdf ") == "10.1234/asdf"
assert clean_doi("10.1037//0002-9432.72.1.50") == "10.1037/0002-9432.72.1.50"
assert clean_doi("10.1037/0002-9432.72.1.50") == "10.1037/0002-9432.72.1.50"
@@ -86,5 +90,6 @@ def clean_pmcid(raw: Optional[str]) -> Optional[str]:
def test_clean_pmcid() -> None:
assert clean_pmcid("10.1234/asdf ") == None
assert clean_pmcid("") == None
+ assert clean_pmcid("1 2") == None
assert clean_pmcid(None) == None
assert clean_pmcid("PMC123") == "PMC123"