diff options
author | Steven Knight <knight@baldmt.com> | 2009-02-06 14:55:23 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2009-02-06 14:55:23 (GMT) |
commit | e112f6b49c9063e6a584ff4f7abf9d7a644eef30 (patch) | |
tree | 978573b4ff11f036428c0a08a89085313ad990fa /test/Value.py | |
parent | 9405dad6e18db3934eec7b992e12a2016b1466db (diff) | |
download | SCons-e112f6b49c9063e6a584ff4f7abf9d7a644eef30.zip SCons-e112f6b49c9063e6a584ff4f7abf9d7a644eef30.tar.gz SCons-e112f6b49c9063e6a584ff4f7abf9d7a644eef30.tar.bz2 |
Commonize new string-search-in-output methods:
test.must_contain_all_lines()
test.must_contain_any_line()
test.must_not_contain_any_line()
Update tests to use them. Remove "import string" lines where the
change made them unnecessary.
Diffstat (limited to 'test/Value.py')
-rw-r--r-- | test/Value.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/test/Value.py b/test/Value.py index 01647e3..01cb370 100644 --- a/test/Value.py +++ b/test/Value.py @@ -26,7 +26,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import re -import string import sys import TestSCons import TestCmd @@ -99,10 +98,7 @@ for source_signature in ['MD5', 'timestamp-newer']: out3 = """create\\(\\["f3.out"\\], \\[<.*.Custom instance at """ #" <- unconfuses emacs syntax highlighting - test.fail_test(string.find(test.stdout(), out1) == -1) - test.fail_test(string.find(test.stdout(), out2) == -1) - test.fail_test(string.find(test.stdout(), out7) == -1) - test.fail_test(string.find(test.stdout(), out8) == -1) + test.must_contain_all_lines(test.stdout(), [out1, out2, out7, out8]) test.fail_test(re.search(out3, test.stdout()) == None) test.must_match('f1.out', "/usr/local") @@ -118,8 +114,7 @@ for source_signature in ['MD5', 'timestamp-newer']: out5 = """create(["f2.out"], [4])""" out6 = """create\\(\\["f3.out"\\], \\[<.*.Custom instance at """ #" <- unconfuses emacs syntax highlighting - test.fail_test(string.find(test.stdout(), out4) == -1) - test.fail_test(string.find(test.stdout(), out5) == -1) + test.must_contain_all_lines(test.stdout(), [out4, out5]) test.fail_test(re.search(out6, test.stdout()) == None) test.must_match('f1.out', "/usr") @@ -134,10 +129,8 @@ for source_signature in ['MD5', 'timestamp-newer']: test.run(arguments='prefix=/var') out4 = """create(["f1.out"], ['/var'])""" - test.fail_test(string.find(test.stdout(), out4) == -1) - test.fail_test(string.find(test.stdout(), out5) != -1) - test.fail_test(string.find(test.stdout(), out7) == -1) - test.fail_test(string.find(test.stdout(), out8) == -1) + test.must_contain_all_lines(test.stdout(), [out4, out7, out8]) + test.must_not_contain_any_line(test.stdout(), [out5]) test.fail_test(re.search(out6, test.stdout()) == None) test.up_to_date('prefix=/var', '.') |