diff options
author | Paweł Tomulik <ptomulik@meil.pw.edu.pl> | 2018-10-05 12:35:41 (GMT) |
---|---|---|
committer | Paweł Tomulik <ptomulik@meil.pw.edu.pl> | 2018-10-05 12:44:38 (GMT) |
commit | 0846483714b5f94bd8f346333479a32b39c90e4f (patch) | |
tree | 1599ba5628f00104313ed58412870ecc7e54b332 /testing/framework/TestCommon.py | |
parent | f03ff1b92efbffd410d744869a3b5327f5d211be (diff) | |
download | SCons-0846483714b5f94bd8f346333479a32b39c90e4f.zip SCons-0846483714b5f94bd8f346333479a32b39c90e4f.tar.gz SCons-0846483714b5f94bd8f346333479a32b39c90e4f.tar.bz2 |
fixed bugs in must_[not_]_contain()
Diffstat (limited to 'testing/framework/TestCommon.py')
-rw-r--r-- | testing/framework/TestCommon.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/testing/framework/TestCommon.py b/testing/framework/TestCommon.py index e55b491..53c0388 100644 --- a/testing/framework/TestCommon.py +++ b/testing/framework/TestCommon.py @@ -292,14 +292,13 @@ class TestCommon(TestCmd): return o.index(l) except ValueError: return None - contains = find(file_contents, required) - if not contains: + if find(file_contents, required) is None: print("File `%s' does not contain required string." % file) print(self.banner('Required string ')) print(required) print(self.banner('%s contents ' % file)) print(file_contents) - self.fail_test(not contains) + self.fail_test() def must_contain_all(self, output, input, title=None, find=None): """Ensures that the specified output string (first argument) @@ -514,14 +513,14 @@ class TestCommon(TestCmd): return o.index(l) except ValueError: return None - contains = find(file_contents, banned) - if contains: + + if find(file_contents, banned) is not None: print("File `%s' contains banned string." % file) print(self.banner('Banned string ')) print(banned) print(self.banner('%s contents ' % file)) print(file_contents) - self.fail_test(contains) + self.fail_test() def must_not_contain_any_line(self, output, lines, title=None, find=None): """Ensures that the specified output string (first argument) |