aboutsummaryrefslogtreecommitdiffstats
path: root/mapreduce/tests/test_grobid2json.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-04-10 16:48:34 -0700
committerBryan Newbold <bnewbold@archive.org>2018-04-10 19:13:53 -0700
commitc62cf313b4d3e3991aa45c09c39b1b92df2893b4 (patch)
tree1c6bb34deb6a27a66d6784edca5200e89f4f1da7 /mapreduce/tests/test_grobid2json.py
parent683844f6bb26d867ea6bd2fd89d7669ace45075a (diff)
downloadsandcrawler-c62cf313b4d3e3991aa45c09c39b1b92df2893b4.tar.gz
sandcrawler-c62cf313b4d3e3991aa45c09c39b1b92df2893b4.zip
failing tests!
Diffstat (limited to 'mapreduce/tests/test_grobid2json.py')
-rw-r--r--mapreduce/tests/test_grobid2json.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mapreduce/tests/test_grobid2json.py b/mapreduce/tests/test_grobid2json.py
index 40853dd..1562006 100644
--- a/mapreduce/tests/test_grobid2json.py
+++ b/mapreduce/tests/test_grobid2json.py
@@ -1,4 +1,5 @@
+import xml
import json
import pytest
from grobid2json import *
@@ -12,3 +13,10 @@ def test_small_xml():
json_form = json.loads(f.read())
assert teixml2json(tei_xml) == json_form
+
+def test_invalid_xml():
+
+ with pytest.raises(xml.etree.ElementTree.ParseError):
+ teixml2json("this is not XML")
+ with pytest.raises(xml.etree.ElementTree.ParseError):
+ teixml2json("<xml></xml>")