mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-08 03:40:06 +02:00
use lxml, factor PAGE creation to utils.xml
This commit is contained in:
parent
14d80700d4
commit
ff7b5ce409
3 changed files with 52 additions and 52 deletions
11
tests/test_xml.py
Normal file
11
tests/test_xml.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue