changeset 27519:f4517c88ab81

test-install: embed wix namespace for Python 2.6 compatibility According to doc, the syntax is "{uri}tag". https://docs.python.org/2.7/library/xml.etree.elementtree.html#parsing-xml-with-namespaces
author Yuya Nishihara <yuya@tcha.org>
date Wed, 23 Dec 2015 22:48:48 +0900
parents 737ffdabbde9
children d8f132f047d6
files tests/test-install.t
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-install.t	Wed Dec 23 17:54:13 2015 +0000
+++ b/tests/test-install.t	Wed Dec 23 22:48:48 2015 +0900
@@ -53,13 +53,13 @@
   > 
   > def directory(node, relpath):
   >     '''generator of files in the xml node, rooted at relpath'''
-  >     dirs = node.findall('./wix:Directory', ns)
+  >     dirs = node.findall('./{%(wix)s}Directory' % ns)
   > 
   >     for d in dirs:
   >         for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
   >             yield subfile
   > 
-  >     files = node.findall('./wix:Component/wix:File', ns)
+  >     files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
   > 
   >     for f in files:
   >         yield relpath + f.attrib['Name']
@@ -83,7 +83,7 @@
   > 
   > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
   > root = xml.getroot()
-  > dir = root.find('.//wix:DirectoryRef', ns)
+  > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
   > 
   > installed = [f for f in directory(dir, '')]
   >