tests/test-install.t
changeset 27519 f4517c88ab81
parent 27442 f67c6d8cc606
child 27631 c18292a6ff54
equal deleted inserted replaced
27518:737ffdabbde9 27519:f4517c88ab81
    51   > testdir = os.environ['TESTDIR']
    51   > testdir = os.environ['TESTDIR']
    52   > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
    52   > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
    53   > 
    53   > 
    54   > def directory(node, relpath):
    54   > def directory(node, relpath):
    55   >     '''generator of files in the xml node, rooted at relpath'''
    55   >     '''generator of files in the xml node, rooted at relpath'''
    56   >     dirs = node.findall('./wix:Directory', ns)
    56   >     dirs = node.findall('./{%(wix)s}Directory' % ns)
    57   > 
    57   > 
    58   >     for d in dirs:
    58   >     for d in dirs:
    59   >         for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
    59   >         for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
    60   >             yield subfile
    60   >             yield subfile
    61   > 
    61   > 
    62   >     files = node.findall('./wix:Component/wix:File', ns)
    62   >     files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
    63   > 
    63   > 
    64   >     for f in files:
    64   >     for f in files:
    65   >         yield relpath + f.attrib['Name']
    65   >         yield relpath + f.attrib['Name']
    66   > 
    66   > 
    67   > def hgdirectory(relpath):
    67   > def hgdirectory(relpath):
    81   > 
    81   > 
    82   > tracked = [f for f in hgdirectory(sys.argv[1])]
    82   > tracked = [f for f in hgdirectory(sys.argv[1])]
    83   > 
    83   > 
    84   > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
    84   > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
    85   > root = xml.getroot()
    85   > root = xml.getroot()
    86   > dir = root.find('.//wix:DirectoryRef', ns)
    86   > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
    87   > 
    87   > 
    88   > installed = [f for f in directory(dir, '')]
    88   > installed = [f for f in directory(dir, '')]
    89   > 
    89   > 
    90   > print('Not installed:')
    90   > print('Not installed:')
    91   > for f in sorted(set(tracked) - set(installed)):
    91   > for f in sorted(set(tracked) - set(installed)):