From 3e5d2f5c6ab9c14b5d33644264af201244c6a9a8 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 8 Nov 2021 16:43:12 -0800 Subject: add multiple-editor test for possible forthcoming GROBID TEI output update --- ...iple_editor_multiple_persname.grobid070.tei.xml | 46 ++++++++++++++++++++++ tests/test_parse.py | 20 ++++++++++ 2 files changed, 66 insertions(+) create mode 100644 tests/files/citation/multiple_editor_multiple_persname.grobid070.tei.xml 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 @@ + + + + + K + Uhlířová + + + + + M + Drumbl + + + Actors and Law Making in International Environmental Law + + + M + Fitzmaurice + + + + + M + Brus + + + + + P + Merkouris + + + +
+ Cheltenham +
+
+ + Edward Elgar Publishing + forthcoming 2020 + 50 + +
+ The Research Handbook on International Environmental Law +
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: -- cgit v1.2.3