From 498677bbe0a04af2ca527bdff83d02bb0710dac9 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 22 Oct 2020 20:17:06 -0700 Subject: improve test coverage --- fatcat_scholar/identifiers.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fatcat_scholar') 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" -- cgit v1.2.3