99)
1010
1111
12- def test_valid_version ():
12+ def test_valid_version () -> None :
1313 """Check that the package defines a valid __version__"""
1414 assert parse_version (__version__ ) >= parse_version ("0.1.0" )
1515
1616
17- def test_validate_doi ():
17+ def test_validate_doi () -> None :
1818 data = [
1919 ('10.1063/1.5081715' ,
2020 'http://aip.scitation.org/doi/10.1063/1.5081715' ),
@@ -29,25 +29,26 @@ def test_validate_doi():
2929 'https://linkinghub.elsevier.com/retrieve/pii/S0009261497040141' ),
3030 ]
3131 for doi , url in data :
32- assert ( url == validate_doi (doi ) )
32+ assert url == validate_doi (doi )
3333
3434 for doi in ['' , 'asdf' ]:
3535 try :
3636 validate_doi (doi )
3737 except ValueError as e :
38- assert ( str (e ) == 'HTTP 404: DOI not found' )
38+ assert str (e ) == 'HTTP 404: DOI not found'
3939
40- def test_get_real_url_from_doi ():
40+
41+ def test_get_real_url_from_doi () -> None :
4142 data = [
4243 ('10.1016/S0009-2614(97)04014-1' ,
4344 'https://www.sciencedirect.com/science/'
4445 'article/abs/pii/S0009261497040141' ),
4546 ]
4647 for doi , url in data :
47- assert ( url == get_real_url_from_doi (doi ) )
48+ assert url == get_real_url_from_doi (doi )
4849
4950
50- def test_find_doi_in_line ():
51+ def test_find_doi_in_line () -> None :
5152 test_data = [
5253 ('http://dx.doi.org/10.1063/1.881498' , '10.1063/1.881498' ),
5354 ('http://dx.doi.org/10.1063%2F1.881498' , '10.1063/1.881498' ),
@@ -61,8 +62,8 @@ def test_find_doi_in_line():
6162 ('/scitation.org/doi/10.1063/1.88149 8?234saf=34' , '10.1063/1.88149' ),
6263 ('/scitation.org/doi/10.1063/1.uniau12?as=234' ,
6364 '10.1063/1.uniau12' ),
64- ('https://doi.org/10.1093/analys/anw053' , '10.1093/analys/anw053' ),
65- ('http://.scitation.org/doi/10.1063/1.mart(88)1498?asdfwer' ,
65+ ('https://doi.org/10.1093/analys/anw053' , '10.1093/analys/anw053' ),
66+ ('http://.scitation.org/doi/10.1063/1.mart(88)1498?asdfwer' ,
6667 '10.1063/1.mart(88)1498' ),
6768 ('@ibook{doi:10.1002/9780470125915.ch2,' , '10.1002/9780470125915.ch2' ),
6869 ('<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1'
@@ -78,10 +79,11 @@ def test_find_doi_in_line():
7879 ('doi(10.1038/s41535-018-0103-6;)' , '10.1038/s41535-018-0103-6' ),
7980 ]
8081 for url , doi in test_data :
81- assert ( find_doi_in_text (url ) == doi )
82+ assert find_doi_in_text (url ) == doi
8283
8384
84- def test_doi_from_pdf ():
85+ def test_doi_from_pdf () -> None :
8586 f = os .path .join (os .path .dirname (__file__ ), 'resources' , 'doc.pdf' )
86- assert (os .path .exists (f ))
87- assert (pdf_to_doi (f ) == '10.1103/PhysRevLett.50.1998' )
87+
88+ assert os .path .exists (f )
89+ assert pdf_to_doi (f ) == '10.1103/PhysRevLett.50.1998'
0 commit comments