summaryrefslogtreecommitdiffstats
path: root/test/textfile.py
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
commit22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/textfile.py
parent75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff)
downloadSCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible; the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'test/textfile.py')
-rw-r--r--test/textfile.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/textfile.py b/test/textfile.py
index 27b6b40..64f8605 100644
--- a/test/textfile.py
+++ b/test/textfile.py
@@ -27,7 +27,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
import os
-import string
test = TestSCons.TestSCons()
@@ -47,8 +46,8 @@ env.Textfile('foo1a.txt', data + [''])
env.Textfile('foo2a.txt', data + [''], LINESEPARATOR='|*')
# recreate the list with the data wrapped in Value()
-data0 = map(Value, data0)
-data = map(Value, data)
+data0 = list(map(Value, data0))
+data = list(map(Value, data))
data[2] = data0
env.Substfile('bar1', data)
@@ -63,25 +62,25 @@ test.run(arguments = '.')
textparts = ['lalala', '42',
'Goethe', 'Schiller',
'tanteratei']
-foo1Text = string.join(textparts, os.linesep)
-foo2Text = string.join(textparts, '|*')
+foo1Text = os.linesep.join(textparts)
+foo2Text = '|*'.join(textparts)
foo1aText = foo1Text + os.linesep
foo2aText = foo2Text + '|*'
test.up_to_date(arguments = '.')
-files = map(test.workpath, (
+files = list(map(test.workpath, (
'foo1.txt', 'foo2.txt', 'foo1a.txt', 'foo2a.txt',
'bar1', 'bar2', 'bar1a.txt', 'bar2a.txt',
- ))
+ )))
def check_times():
# make sure the files didn't get rewritten, because nothing changed:
- before = map(os.path.getmtime, files)
+ before = list(map(os.path.getmtime, files))
# introduce a small delay, to make the test valid
test.sleep()
# should still be up-to-date
test.up_to_date(arguments = '.')
- after = map(os.path.getmtime, files)
+ after = list(map(os.path.getmtime, files))
test.fail_test(before != after)
# make sure that the file content is as expected
@@ -142,7 +141,7 @@ line3a = 'This line has %subst% substitutions'
line3b = 'This line has many substitutions'
def matchem(file, lines):
- lines = string.join(lines, os.linesep)
+ lines = os.linesep.join(lines)
test.must_match(file, lines)
matchem('text.txt', [line1, line2a, line3a])