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/option/profile.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/option/profile.py')
-rw-r--r-- | test/option/profile.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/option/profile.py b/test/option/profile.py index d0c0ffc..aafebda 100644 --- a/test/option/profile.py +++ b/test/option/profile.py @@ -46,7 +46,7 @@ test.write('file.in', "file.in\n") scons_prof = test.workpath('scons.prof') test.run(arguments = "--profile=%s -h" % scons_prof) -test.fail_test(string.find(test.stdout(), 'usage: scons [OPTION]') == -1) +test.must_contain_all_lines(test.stdout(), ['usage: scons [OPTION]']) try: save_stdout = sys.stdout @@ -61,8 +61,7 @@ try: finally: sys.stdout = save_stdout -test.fail_test(string.find(s, 'Main.py') == -1) -test.fail_test(string.find(s, '_main') == -1) +test.must_contain_all_lines(s, ['Main.py', '_main']) @@ -83,17 +82,18 @@ try: finally: sys.stdout = save_stdout -test.fail_test(string.find(s, 'Main.py') == -1) -test.fail_test(string.find(s, '_main') == -1) -test.fail_test(string.find(s, 'FS.py') == -1) +test.must_contain_all_lines(s, ['Main.py', '_main', 'FS.py']) scons_prof = test.workpath('scons3.prof') test.run(arguments = "--profile %s --debug=memory -h" % scons_prof) -test.fail_test(string.find(test.stdout(), 'usage: scons [OPTION]') == -1) -test.fail_test(string.find(test.stdout(), 'Options:') == -1) +expect = [ + 'usage: scons [OPTION]', + 'Options:' +] +test.must_contain_all_lines(test.stdout(), expect) expect = 'Memory before reading SConscript files' lines = string.split(test.stdout(), '\n') |