diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-03-13 14:44:38 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-03-13 14:44:38 (GMT) |
commit | 3b23df1f6b2135739b988a497d98d85dd8a806fa (patch) | |
tree | a359f776956c796bc88084079dc7d1d7c951f99c /test/Ghostscript | |
parent | 8d600a70cdbdaf648e0ef5405cb8d321de12a4a2 (diff) | |
download | SCons-3b23df1f6b2135739b988a497d98d85dd8a806fa.zip SCons-3b23df1f6b2135739b988a497d98d85dd8a806fa.tar.gz SCons-3b23df1f6b2135739b988a497d98d85dd8a806fa.tar.bz2 |
py2/3 fix rb/wb, switch to must_match and mode='r'
Diffstat (limited to 'test/Ghostscript')
-rw-r--r-- | test/Ghostscript/GS.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/Ghostscript/GS.py b/test/Ghostscript/GS.py index daeea09..3f5aa58 100644 --- a/test/Ghostscript/GS.py +++ b/test/Ghostscript/GS.py @@ -38,8 +38,8 @@ test = TestSCons.TestSCons() test.write('mygs.py', r""" import os import sys -outfile = open(sys.argv[1], 'wb') -infile = open(sys.argv[2], 'rb') +outfile = open(sys.argv[1], 'w') +infile = open(sys.argv[2], 'r') for l in infile.readlines(): if l[:3] != '#ps': outfile.write(l) @@ -60,8 +60,8 @@ test.write('test1.ps', r"""This is a .ps test. test.run(arguments = '.', stderr = None) -test.fail_test(test.read('test1.pdf') != "This is a .ps test.\n") -test.fail_test(test.read('test2.pdf') != "This is a .ps test.\n") +test.must_match('test1.pdf', "This is a .ps test.\n", mode='r') +test.must_match('test2.pdf', "This is a .ps test.\n", mode='r') @@ -79,7 +79,7 @@ if gs: import os import sys cmd = " ".join(sys.argv[1:]) -open('%s', 'ab').write("%%s\\n" %% cmd) +open('%s', 'a').write("%%s\\n" %% cmd) os.system(cmd) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) @@ -110,7 +110,7 @@ bar.PDF(target = 'bar.pdf', source = 'bar.ps') test.run(arguments = 'bar.pdf', stderr = None) - test.fail_test(test.read('wrapper.out') != "%s -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bar.pdf bar.ps\n" % gs_executable) + test.must_match('wrapper.out', "%s -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bar.pdf bar.ps\n" % gs_executable, mode='r') test.fail_test(not os.path.exists(test.workpath('bar.pdf'))) |