From 99b0ab9e0c3b860754f05cc96c350e2608f932ff Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Nov 2021 20:36:51 -0700 Subject: add a test for a proceedings citation; 'meeting' is not implemented yet --- tests/files/citation/citation_proceedings.tei.xml | 36 +++++++++++++++++++++++ tests/test_parse.py | 22 ++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/files/citation/citation_proceedings.tei.xml diff --git a/tests/files/citation/citation_proceedings.tei.xml b/tests/files/citation/citation_proceedings.tei.xml new file mode 100644 index 0000000..96dbd13 --- /dev/null +++ b/tests/files/citation/citation_proceedings.tei.xml @@ -0,0 +1,36 @@ + + + Sim-to-Real Transfer of Robotic Control with Dynamics Randomization + + + Marcin + Xue Bin Peng + + + + + Wojciech + Andrychowicz + + + + + Pieter + Zaremba + + + + + Abbeel + + + + + Proceedings - IEEE International Conference on Robotics and Automation + IEEE International Conference on Robotics and Automation + + 2018. 2018 + + + + diff --git a/tests/test_parse.py b/tests/test_parse.py index a818f09..9e903fa 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -456,3 +456,25 @@ def test_citation_bare_editor() -> None: assert ref.editors assert len(ref.editors) == 1 assert ref.editors[0].full_name == "Mitchell C" + + +def test_citation_proceedings() -> None: + with open("tests/files/citation/citation_proceedings.tei.xml", "r") as f: + tei_xml = f.read() + + ref = parse_citation_xml(tei_xml) + assert ref + assert ref.title == "Sim-to-Real Transfer of Robotic Control with Dynamics Randomization" + assert ( + ref.book_title + == "Proceedings - IEEE International Conference on Robotics and Automation" + ) + # TODO: ref.meeting: IEEE International Conference on Robotics and Automation + assert ref.publisher is None + # 2018. 2018 + assert ref.pages == "3803-3810" + assert ref.date == "2018" + assert ref.authors + assert ref.authors[0].given_name == "Marcin" + assert ref.authors[3].full_name == "Abbeel" + assert ref.editors is None -- cgit v1.2.3