40
40
github_as_repo_url ,
41
41
from_curie ,
42
42
extract_curie ,
43
+ replace_curie ,
43
44
get_language ,
44
45
validate_url ,
45
46
format_name_identifier ,
@@ -815,6 +816,7 @@ def test_from_curie():
815
816
"ISNI:0000000121099845"
816
817
)
817
818
819
+
818
820
def test_extract_curie ():
819
821
"""extract_curie"""
820
822
string = """Melstrom, Keegan M., Michael D. D’Emic, Daniel Chure and Jeffrey A.
@@ -835,14 +837,31 @@ def test_extract_curie_doi_space():
835
837
assert "https://doi.org/10.1080/02724634.2016.1111898" == extract_curie (string )
836
838
837
839
840
+ def test_replace_curie ():
841
+ """replace_curie"""
842
+ string = """Melstrom, Keegan M., Michael D. D’Emic, Daniel Chure and Jeffrey A.
843
+ Wilson. 2016. A juvenile sauropod dinosaur from the Late Jurassic of
844
+ Utah, USA, presents further evidence of an avian style air-sac
845
+ system. Journal of Vertebrate Paleontology 36(4):e1111898. doi:10.1080/02724634.2016.1111898"""
846
+ assert """Melstrom, Keegan M., Michael D. D’Emic, Daniel Chure and Jeffrey A.
847
+ Wilson. 2016. A juvenile sauropod dinosaur from the Late Jurassic of
848
+ Utah, USA, presents further evidence of an avian style air-sac
849
+ system. Journal of Vertebrate Paleontology 36(4):e1111898. https://doi.org/10.1080/02724634.2016.1111898""" == replace_curie (string )
850
+
851
+
838
852
def test_extract_urls ():
839
853
"""extract_urls"""
840
854
string = """Zauner, H. (2025, January 9). Sex chromosome madness in the iconic echidna. GigaBlog. https://doi.org/10.59350/9509z-ns663
841
855
842
856
Willighagen, E. (2024, December 30). FAIR blog-to-blog citations. Chem-Bla-Ics. https://doi.org/10.59350/er1mn-m5q69
843
857
844
858
Marcum, C. S. (2024, August 27). Drinking from the Firehose? Write More and Publish Less. Upstream. https://doi.org/10.54900/r8zwg-62003"""
845
- assert ['https://doi.org/10.59350/9509z-ns663' ,'https://doi.org/10.59350/er1mn-m5q69' ,'https://doi.org/10.54900/r8zwg-62003' ,] == extract_urls (string )
859
+ assert [
860
+ "https://doi.org/10.59350/9509z-ns663" ,
861
+ "https://doi.org/10.59350/er1mn-m5q69" ,
862
+ "https://doi.org/10.54900/r8zwg-62003" ,
863
+ ] == extract_urls (string )
864
+
846
865
847
866
def test_extract_urls_markdown ():
848
867
"""extract_urls markdown"""
@@ -854,12 +873,21 @@ def test_extract_urls_markdown():
854
873
855
874
Marcum, C. S. (2024, August 27). Drinking from the Firehose? Write More
856
875
and Publish Less. *Upstream*. <https://doi.org/10.54900/r8zwg-62003>"""
857
- assert ['https://doi.org/10.59350/9509z-ns663' , 'https://doi.org/10.59350/er1mn-m5q69' , 'https://doi.org/10.54900/r8zwg-62003' ] == extract_urls (string )
876
+ assert [
877
+ "https://doi.org/10.59350/9509z-ns663" ,
878
+ "https://doi.org/10.59350/er1mn-m5q69" ,
879
+ "https://doi.org/10.54900/r8zwg-62003" ,
880
+ ] == extract_urls (string )
881
+
858
882
859
883
def test_extract_urls_html ():
860
884
"""extract_urls html"""
861
885
string = """<p>Zauner, H. (2025, January 9). Sex chromosome madness in the iconic echidna. <em>GigaBlog</em>. <a href="https://doi.org/10.59350/9509z-ns663">https://doi.org/10.59350/9509z-ns663</a></p><p>Willighagen, E. (2024, December 30). FAIR blog-to-blog citations. <em>Chem-Bla-Ics</em>. <a href="https://doi.org/10.59350/er1mn-m5q69">https://doi.org/10.59350/er1mn-m5q69</a></p><p>Marcum, C. S. (2024, August 27). Drinking from the Firehose? Write More and Publish Less. <em>Upstream</em>. <a href="https://doi.org/10.54900/r8zwg-62003">https://doi.org/10.54900/r8zwg-62003</a></p>"""
862
- assert ['https://doi.org/10.59350/9509z-ns663' , 'https://doi.org/10.59350/er1mn-m5q69' , 'https://doi.org/10.54900/r8zwg-62003' ] == extract_urls (string )
886
+ assert [
887
+ "https://doi.org/10.59350/9509z-ns663" ,
888
+ "https://doi.org/10.59350/er1mn-m5q69" ,
889
+ "https://doi.org/10.54900/r8zwg-62003" ,
890
+ ] == extract_urls (string )
863
891
864
892
865
893
def test_id_from_url ():
0 commit comments