From 82cbabc249e5c0375dbb82106451969467f8da00 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 6 Apr 2018 14:17:30 -0700 Subject: add test for grobid2json --- mapreduce/tests/test_grobid2json.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mapreduce/tests/test_grobid2json.py diff --git a/mapreduce/tests/test_grobid2json.py b/mapreduce/tests/test_grobid2json.py new file mode 100644 index 0000000..40853dd --- /dev/null +++ b/mapreduce/tests/test_grobid2json.py @@ -0,0 +1,14 @@ + +import json +import pytest +from grobid2json import * + + +def test_small_xml(): + + with open('tests/files/small.xml', 'r') as f: + tei_xml = f.read() + with open('tests/files/small.json', 'r') as f: + json_form = json.loads(f.read()) + + assert teixml2json(tei_xml) == json_form -- cgit v1.2.3