comparison tests/test-install.t @ 41318:6e54caaed08d

tests: normalize to bytes in test-install.t directory() was returning str and hgdirectory() was returning bytes. This made the set compare fail. Let's normalize the types on Python 3 so the test passes. Differential Revision: https://phab.mercurial-scm.org/D5650
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 22 Jan 2019 17:50:52 -0800
parents 2465e0b27a0d
children baffda74891c
comparison
equal deleted inserted replaced
41317:4ad002b2584d 41318:6e54caaed08d
159 $ cat >> wixxml.py << EOF 159 $ cat >> wixxml.py << EOF
160 > import os 160 > import os
161 > import subprocess 161 > import subprocess
162 > import sys 162 > import sys
163 > import xml.etree.ElementTree as ET 163 > import xml.etree.ElementTree as ET
164 > from mercurial import pycompat
164 > 165 >
165 > # MSYS mangles the path if it expands $TESTDIR 166 > # MSYS mangles the path if it expands $TESTDIR
166 > testdir = os.environ['TESTDIR'] 167 > testdir = os.environ['TESTDIR']
167 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'} 168 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
168 > 169 >
175 > yield subfile 176 > yield subfile
176 > 177 >
177 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns) 178 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
178 > 179 >
179 > for f in files: 180 > for f in files:
180 > yield relpath + f.attrib['Name'] 181 > yield pycompat.sysbytes(relpath + f.attrib['Name'])
181 > 182 >
182 > def hgdirectory(relpath): 183 > def hgdirectory(relpath):
183 > '''generator of tracked files, rooted at relpath''' 184 > '''generator of tracked files, rooted at relpath'''
184 > hgdir = "%s/../mercurial" % (testdir) 185 > hgdir = "%s/../mercurial" % (testdir)
185 > args = ['hg', '--cwd', hgdir, 'files', relpath] 186 > args = ['hg', '--cwd', hgdir, 'files', relpath]
202 > 203 >
203 > installed = [f for f in directory(dir, '')] 204 > installed = [f for f in directory(dir, '')]
204 > 205 >
205 > print('Not installed:') 206 > print('Not installed:')
206 > for f in sorted(set(tracked) - set(installed)): 207 > for f in sorted(set(tracked) - set(installed)):
207 > print(' %s' % f) 208 > print(' %s' % pycompat.sysstr(f))
208 > 209 >
209 > print('Not tracked:') 210 > print('Not tracked:')
210 > for f in sorted(set(installed) - set(tracked)): 211 > for f in sorted(set(installed) - set(tracked)):
211 > print(' %s' % f) 212 > print(' %s' % pycompat.sysstr(f))
212 > EOF 213 > EOF
213 214
214 $ ( testrepohgenv; "$PYTHON" wixxml.py help ) 215 $ ( testrepohgenv; "$PYTHON" wixxml.py help )
215 Not installed: 216 Not installed:
216 help/common.txt 217 help/common.txt