1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-31 02:43:06 +03:00

tests: Fix out-of-tree Python tests

This commit is contained in:
Nick Wellnhofer
2022-09-07 21:05:21 +02:00
parent 367b929460
commit cc64f2a78b

View File

@ -1,15 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
import os
import sys import sys
import libxml2 import libxml2
# Memory debug specific # Memory debug specific
libxml2.debugMemory(1) libxml2.debugMemory(1)
import libxslt import libxslt
basedir = os.path.dirname(os.path.realpath(__file__))
styledoc = libxml2.parseFile("%s/test.xsl" % basedir)
styledoc = libxml2.parseFile("test.xsl")
style = libxslt.parseStylesheetDoc(styledoc) style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseFile("test.xml") doc = libxml2.parseFile("%s/test.xml" % basedir)
result = style.applyStylesheet(doc, None) result = style.applyStylesheet(doc, None)
style.saveResultToFilename("foo", result, 0) style.saveResultToFilename("foo", result, 0)
stringval = style.saveResultToString(result) stringval = style.saveResultToString(result)