[libxslt] tests: Fix out-of-tree Python tests
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] tests: Fix out-of-tree Python tests
- Date: Wed, 7 Sep 2022 20:19:07 +0000 (UTC)
commit cc64f2a78b535ba5f8e05448925f56d39d270d65
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Wed Sep 7 21:05:21 2022 +0200
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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]