From cc64f2a78b535ba5f8e05448925f56d39d270d65 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Wed, 7 Sep 2022 21:05:21 +0200 Subject: [PATCH] tests: Fix out-of-tree Python tests --- python/tests/basic.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/tests/basic.py b/python/tests/basic.py index 46355de7..a9d71188 100755 --- a/python/tests/basic.py +++ b/python/tests/basic.py @@ -1,15 +1,16 @@ #!/usr/bin/env python +import os import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) import libxslt +basedir = os.path.dirname(os.path.realpath(__file__)) - -styledoc = libxml2.parseFile("test.xsl") +styledoc = libxml2.parseFile("%s/test.xsl" % basedir) style = libxslt.parseStylesheetDoc(styledoc) -doc = libxml2.parseFile("test.xml") +doc = libxml2.parseFile("%s/test.xml" % basedir) result = style.applyStylesheet(doc, None) style.saveResultToFilename("foo", result, 0) stringval = style.saveResultToString(result)