diff options
Diffstat (limited to 'mapreduce/tests/test_grobid2json.py')
-rw-r--r-- | mapreduce/tests/test_grobid2json.py | 8 |
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>") |