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
368 B
Python

from lxml import etree as ET
from sbb_newspapers_org_image.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