summaryrefslogtreecommitdiffstats
path: root/test/Default.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-20 17:50:13 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-20 17:50:13 (GMT)
commit826315a8e44157d41ab9f1eadaf364b06566ec02 (patch)
treec729f0a9645cf95f30f9eaf8274e61bca0d1c780 /test/Default.py
parent6659da8dda800c8d19d3efc01ec3c6607cbb04ab (diff)
downloadSCons-826315a8e44157d41ab9f1eadaf364b06566ec02.zip
SCons-826315a8e44157d41ab9f1eadaf364b06566ec02.tar.gz
SCons-826315a8e44157d41ab9f1eadaf364b06566ec02.tar.bz2
py2/3 fix must_match and rb/wb
Diffstat (limited to 'test/Default.py')
-rw-r--r--test/Default.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/Default.py b/test/Default.py
index b8ccce2..e9ca96a 100644
--- a/test/Default.py
+++ b/test/Default.py
@@ -46,8 +46,8 @@ for dir in ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight']:
test.write('build.py', r"""
import sys
-contents = open(sys.argv[2], 'rb').read()
-file = open(sys.argv[1], 'wb')
+contents = open(sys.argv[2], 'r').read()
+file = open(sys.argv[1], 'w')
file.write(contents)
file.close()
""")
@@ -98,21 +98,21 @@ for dir in ['one', 'two', 'three', 'four', 'five']:
test.run(chdir = dir) # no arguments, use the Default
-test.fail_test(test.read(test.workpath('one', 'foo.out')) != "one/foo.in\n")
+test.must_match(test.workpath('one', 'foo.out'), "one/foo.in\n")
test.fail_test(os.path.exists(test.workpath('one', 'bar')))
-test.fail_test(test.read(test.workpath('two', 'foo.out')) != "two/foo.in\n")
-test.fail_test(test.read(test.workpath('two', 'bar.out')) != "two/bar.in\n")
+test.must_match(test.workpath('two', 'foo.out'), "two/foo.in\n")
+test.must_match(test.workpath('two', 'bar.out'), "two/bar.in\n")
-test.fail_test(test.read(test.workpath('three', 'foo.out')) != "three/foo.in\n")
-test.fail_test(test.read(test.workpath('three', 'bar.out')) != "three/bar.in\n")
+test.must_match(test.workpath('three', 'foo.out'), "three/foo.in\n")
+test.must_match(test.workpath('three', 'bar.out'), "three/bar.in\n")
test.fail_test(os.path.exists(test.workpath('four', 'foo')))
test.fail_test(os.path.exists(test.workpath('four', 'bar')))
-test.fail_test(test.read(test.workpath('four', 'foo bar')) != "four/foo.in\n")
+test.must_match(test.workpath('four', 'foo bar'), "four/foo.in\n")
-test.fail_test(test.read(test.workpath('five', 'foo.out')) != "five/foo.in\n")
-test.fail_test(test.read(test.workpath('five', 'bar.out')) != "five/bar.in\n")
+test.must_match(test.workpath('five', 'foo.out'), "five/foo.in\n")
+test.must_match(test.workpath('five', 'bar.out'), "five/bar.in\n")
@@ -150,7 +150,7 @@ Default(foo, None, bar)
test.run(chdir = 'eight') # no arguments, use the Default
test.fail_test(os.path.exists(test.workpath('eight', 'foo.out')))
-test.fail_test(test.read(test.workpath('eight', 'bar.out')) != "eight/bar.in\n")
+test.must_match(test.workpath('eight', 'bar.out'), "eight/bar.in\n")
@@ -178,7 +178,7 @@ test.write(['nine', 'sub1', 'xxx.in'], "sub1/xxx.in\n")
test.run(chdir = 'nine') # no arguments, use the Default
test.fail_test(os.path.exists(test.workpath('nine', 'xxx.out')))
-test.fail_test(test.read(test.workpath('nine', 'sub1', 'xxx.out')) != "sub1/xxx.in\n")
+test.must_match(test.workpath('nine', 'sub1', 'xxx.out'), "sub1/xxx.in\n")
@@ -205,7 +205,7 @@ test.write(['ten', 'sub2', 'xxx.in'], "sub2/xxx.in\n")
test.run(chdir = 'ten') # no arguments, use the Default
test.fail_test(os.path.exists(test.workpath('ten', 'xxx.out')))
-test.fail_test(test.read(test.workpath('ten', 'sub2', 'xxx.out')) != "sub2/xxx.in\n")
+test.must_match(test.workpath('ten', 'sub2', 'xxx.out'), "sub2/xxx.in\n")
test.subdir('eleven')
@@ -218,13 +218,13 @@ env.B(target = 'bar.out', source = 'bar.in')
env.Default('$XXX')
""" % locals())
-test.write(os.path.join('eleven', 'foo.in'), "eleven/foo.in\n");
+test.write(os.path.join('eleven', 'foo.in'), "eleven/foo.in\n")
-test.write(os.path.join('eleven', 'bar.in'), "eleven/bar.in\n");
+test.write(os.path.join('eleven', 'bar.in'), "eleven/bar.in\n")
test.run(chdir = 'eleven') # no arguments, use the Default
-test.fail_test(test.read(test.workpath('eleven', 'foo.out')) != "eleven/foo.in\n")
+test.must_match(test.workpath('eleven', 'foo.out'), "eleven/foo.in\n")
test.fail_test(os.path.exists(test.workpath('eleven', 'bar')))