Ignore conversions_test() output differences on Windows

main
LeoHsiao 5 years ago
parent daa2a6fda5
commit e976d3795a

@ -231,6 +231,15 @@ class TestCases(unittest.TestCase):
out += BT.execute('exiv2 -M"del Xmp.mwg-rs.Regions" DSC_3079.jpg') out += BT.execute('exiv2 -M"del Xmp.mwg-rs.Regions" DSC_3079.jpg')
out += BT.execute('exiv2 -px DSC_3079.jpg') out += BT.execute('exiv2 -px DSC_3079.jpg')
# Ignore the output differences on Windows
for pair in [
('charset="Jis"', 'charset=Jis'),
('charset="Unicode"', 'charset=Unicode'),
(' 9 Rocknroll', "11 Rock'n'roll"),
('Rocknroll', "Rock'n'roll")
]:
out = str(out).replace(pair[0], pair[1])
BT.reportTest('conversions', out) BT.reportTest('conversions', out)

@ -476,7 +476,7 @@ def printTest(filename):
good_file = os.path.join(Config.data_dir, filename + '.ipgd') good_file = os.path.join(Config.data_dir, filename + '.ipgd')
copyTestFile(filename, test_file) copyTestFile(filename, test_file)
output = execute('iptcprint {src_file}', vars(), expected_returncodes=None, return_bytes=True) output = execute('iptcprint {src_file}', vars(), expected_returncodes=None, return_bytes=True)
output = output.replace(Config.data_dir.replace(os.path.sep, '/').encode(), b'../data') # Ignore the difference of data_dir output = output.replace(Config.data_dir.replace(os.path.sep, '/').encode(), b'../data') # Ignore the difference of data_dir on Windows
save(output + b'\n', test_file) save(output + b'\n', test_file)
return diffCheck(good_file, test_file, in_bytes=True) return diffCheck(good_file, test_file, in_bytes=True)

Loading…
Cancel
Save