Fix check_must_contain_regex in verify_archive.bzl (#910)
* Fix check_must_contain_regex in verify_archive.bzl
* fix the Python template test class
diff --git a/pkg/verify_archive_test_main.py.tpl b/pkg/verify_archive_test_main.py.tpl
index f831ecb..f0b9719 100644
--- a/pkg/verify_archive_test_main.py.tpl
+++ b/pkg/verify_archive_test_main.py.tpl
@@ -96,13 +96,12 @@
if r_comp.match(path):
matched = True
break
- if not match:
+ if not matched:
self.fail('Did not find pattern (%s) in the archive' % pattern)
def check_must_not_contain_regex(self, must_not_contain_regex):
for pattern in must_not_contain_regex:
r_comp = re.compile(pattern)
- matched = False
for path in self.paths:
if r_comp.match(path):
self.fail('Found disallowed pattern (%s) in the archive' % pattern)
@@ -134,10 +133,10 @@
def test_must_not_contain(self):
self.check_must_not_contain(${MUST_NOT_CONTAIN})
- def test_must_not_contain(self):
+ def test_must_contain_regex(self):
self.check_must_contain_regex(${MUST_CONTAIN_REGEX})
- def test_must_not_contain(self):
+ def test_must_not_contain_regex(self):
self.check_must_not_contain_regex(${MUST_NOT_CONTAIN_REGEX})
def test_verify_links(self):