You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eynollah/tests/test_xml.py

12 lines
360 B
Python

from lxml import etree as ET
from qurator.eynollah.utils.xml import create_page_xml, NAMESPACES
def tostring(el):
return ET.tostring(el).decode('utf-8')
def test_create_xml():
pcgts, page = create_page_xml('/path/to/img.tif', 100, 100)
xmlstr = tostring(pcgts)
assert 'xmlns="%s"' % NAMESPACES[None] in xmlstr
assert 'Metadata' in xmlstr