diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-11-08 16:43:12 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-11-08 16:43:12 -0800 |
commit | 3e5d2f5c6ab9c14b5d33644264af201244c6a9a8 (patch) | |
tree | 79959111a9af15e0fb82dd8d80666c774c3361f4 /tests | |
parent | 1724144bfc4f36c209929502b5ecbeb0145ef98f (diff) | |
download | grobid_tei_xml-3e5d2f5c6ab9c14b5d33644264af201244c6a9a8.tar.gz grobid_tei_xml-3e5d2f5c6ab9c14b5d33644264af201244c6a9a8.zip |
add multiple-editor test for possible forthcoming GROBID TEI output update
Diffstat (limited to 'tests')
-rw-r--r-- | tests/files/citation/multiple_editor_multiple_persname.grobid070.tei.xml | 46 | ||||
-rw-r--r-- | tests/test_parse.py | 20 |
2 files changed, 66 insertions, 0 deletions
diff --git a/tests/files/citation/multiple_editor_multiple_persname.grobid070.tei.xml b/tests/files/citation/multiple_editor_multiple_persname.grobid070.tei.xml new file mode 100644 index 0000000..b33a7b3 --- /dev/null +++ b/tests/files/citation/multiple_editor_multiple_persname.grobid070.tei.xml @@ -0,0 +1,46 @@ +<biblStruct > + <monogr> + <author> + <persName> + <forename type="first">K</forename> + <surname>Uhlířová</surname> + </persName> + </author> + <author> + <persName> + <forename type="first">M</forename> + <surname>Drumbl</surname> + </persName> + </author> + <title level="m">Actors and Law Making in International Environmental Law</title> + <editor> + <persName> + <forename type="first">M</forename> + <surname>Fitzmaurice</surname> + </persName> + </editor> + <editor> + <persName> + <forename type="first">M</forename> + <surname>Brus</surname> + </persName> + </editor> + <editor> + <persName> + <forename type="first">P</forename> + <surname>Merkouris</surname> + </persName> + </editor> + <meeting> + <address> + <addrLine>Cheltenham</addrLine> + </address> + </meeting> + <imprint> + <publisher>Edward Elgar Publishing</publisher> + <date type="published" when="2020">forthcoming 2020</date> + <biblScope unit="volume">50</biblScope> + </imprint> + </monogr> + <note>The Research Handbook on International Environmental Law</note> +</biblStruct> diff --git a/tests/test_parse.py b/tests/test_parse.py index 9e903fa..cb2e1da 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -411,6 +411,26 @@ def test_citation_multiple_editors() -> None: assert ref.date == "1996" assert ref.note == "12th ed. Baltimore" + # Uhlířová, K., Drumbl, M. (forthcoming 2020): Actors and Law Making in International Environmental Law, in M. Fitzmaurice, M. Brus and P. Merkouris (eds.): The Research Handbook on International Environmental Law. Cheltenham: Edward Elgar Publishing. 50 p. + with open( + "tests/files/citation/multiple_editor_multiple_persname.grobid070.tei.xml", "r" + ) as f: + tei_xml = f.read() + + ref = parse_citation_xml(tei_xml) + assert ref + assert ref.title == "Actors and Law Making in International Environmental Law" + assert len(ref.authors) == 2 + assert ref.authors[0].full_name == "K Uhlířová" + assert ref.editors + assert len(ref.editors) == 3 + assert ref.editors[0].full_name == "M Fitzmaurice" + assert ref.editors[1].full_name == "M Brus" + assert ref.editors[2].full_name == "P Merkouris" + assert ref.publisher == "Edward Elgar Publishing" + assert ref.date == "2020" + assert ref.note == "The Research Handbook on International Environmental Law" + def test_author_email() -> None: with open("tests/files/document/author_email.tei.xml", "r") as f: |