コード例 #1
0
 def test_it_returns_none_if_invalid(self, doi):
     assert doi_uri_from_string(doi) is None
コード例 #2
0
 def test_it_strips_whitespace(self, doi):
     assert doi_uri_from_string(doi) == re.sub('\\s+', '', doi)
コード例 #3
0
 def test_it_allows_doi_urls(self, url):
     # Many sites store DOI URLs rather than just identifiers in DOI fields.
     # We should ideally normalize the different forms, but for now we just
     # continue to accept them.
     assert doi_uri_from_string(url) == 'doi:{}'.format(url)
コード例 #4
0
 def test_it_prepends_doi_prefix(self, doi):
     assert doi_uri_from_string(doi) == 'doi:{}'.format(
         strip_prefix('doi:', doi))
コード例 #5
0
 def test_it_strips_whitespace(self, doi):
     assert doi_uri_from_string(doi) == re.sub("\\s+", "", doi)
コード例 #6
0
 def test_it_prepends_doi_prefix(self, doi):
     assert doi_uri_from_string(doi) == "doi:{}".format(
         strip_prefix("doi:", doi))
コード例 #7
0
ファイル: document_claims_test.py プロジェクト: kaydoh/h
 def test_it_prepends_doi_prefix(self, doi):
     assert doi_uri_from_string(doi) == f"doi:{strip_prefix('doi:', doi)}"