summaryrefslogtreecommitdiff
path: root/test/textfile.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-05-26 16:32:47 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2017-05-26 16:32:47 -0700
commit73dd794c4cd047a60918a8256e47a371323f43f9 (patch)
treedf88e24a210ccaee33980401012528d613feed83 /test/textfile.py
parente07506c1979223680a0324bdcf804be84dc3bd3e (diff)
downloadscons-73dd794c4cd047a60918a8256e47a371323f43f9.tar.gz
py2/3 fix so test/textfile.py works with py3
Diffstat (limited to 'test/textfile.py')
-rw-r--r--test/textfile.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/textfile.py b/test/textfile.py
index 91e95e99..46eee344 100644
--- a/test/textfile.py
+++ b/test/textfile.py
@@ -35,7 +35,7 @@ foo1 = test.workpath('foo1.txt')
#foo1a = test.workpath('foo1a.txt')
#foo2a = test.workpath('foo2a.txt')
-match_mode = 'rb'
+match_mode = 'r'
test.write('SConstruct', """
env = Environment(tools=['textfile'])
@@ -61,12 +61,14 @@ env.Substfile('bar2a.txt', data, LINESEPARATOR='|*')
test.run(arguments='.')
+linesep = '\n'
+
textparts = ['lalala', '42',
'Goethe', 'Schiller',
'tanteratei']
-foo1Text = os.linesep.join(textparts)
+foo1Text = linesep.join(textparts)
foo2Text = '|*'.join(textparts)
-foo1aText = foo1Text + os.linesep
+foo1aText = foo1Text + linesep
foo2aText = foo2Text + '|*'
test.up_to_date(arguments='.')
@@ -153,8 +155,8 @@ def matchem(match_file, lines):
Join all the lines with correct line separator,
then compare
"""
- lines = os.linesep.join(lines)
- test.must_match(match_file, lines, mode=match_mode)
+ lines = linesep.join(lines)
+ test.must_match(match_file, lines, mode=match_mode, message="Expected:\n%s\n"%lines)
matchem('text.txt', [line1, line2a, line3a])