summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest/tests/test_mbox_author.py
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2023-10-12 09:24:59 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-13 11:53:06 +0100
commitfd06e4f2664b69a2776cdc8188dba6e6e958d86a (patch)
tree2b26efe798c2169eeeea6e9c24ae5ac72d9fa9df /meta/lib/patchtest/tests/test_mbox_author.py
parent2fdabc368a52a9bf60f76f33e92b94de843688a8 (diff)
downloadpoky-fd06e4f2664b69a2776cdc8188dba6e6e958d86a.tar.gz
patchtest: clean up test suite
Various tweaks to make the test suite cleaner and more efficient: - Replace use of "re" module with "pyparsing" in tests (but not base.py) - Make test_mbox_cve only check for CVE tags in the commit if the added patch has them - Make test_mbox_cve SKIP instead of PASS if there's no CVE tag - Simplify the bugzilla tag checking test now that pyparsing is used - Modify the selftest script to correctly parse the new result output (From OE-Core rev: 7a187c2475aa762e2bc830950f608143f2535a72) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests/test_mbox_author.py')
-rw-r--r--meta/lib/patchtest/tests/test_mbox_author.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox_author.py b/meta/lib/patchtest/tests/test_mbox_author.py
index fb8f10e1fd..e68e7a5ac4 100644
--- a/meta/lib/patchtest/tests/test_mbox_author.py
+++ b/meta/lib/patchtest/tests/test_mbox_author.py
@@ -5,22 +5,22 @@
5# SPDX-License-Identifier: GPL-2.0 5# SPDX-License-Identifier: GPL-2.0
6 6
7import base 7import base
8import re 8import pyparsing
9 9
10class Author(base.Base): 10class Author(base.Base):
11 11
12 auh_email = '<auh@auh.yoctoproject.org>' 12 auh_email = 'auh@auh.yoctoproject.org'
13 13
14 invalids = [re.compile("^Upgrade Helper.+"), 14 invalids = [pyparsing.Regex("^Upgrade Helper.+"),
15 re.compile(re.escape(auh_email)), 15 pyparsing.Regex(auh_email),
16 re.compile("uh@not\.set"), 16 pyparsing.Regex("uh@not\.set"),
17 re.compile("\S+@example\.com")] 17 pyparsing.Regex("\S+@example\.com")]
18 18
19 19
20 def test_author_valid(self): 20 def test_author_valid(self):
21 for commit in self.commits: 21 for commit in self.commits:
22 for invalid in self.invalids: 22 for invalid in self.invalids:
23 if invalid.search(commit.author): 23 if invalid.search_string(commit.author):
24 self.fail('Invalid author %s. Resend the series with a valid patch author' % commit.author, commit=commit) 24 self.fail('Invalid author %s. Resend the series with a valid patch author' % commit.author, commit=commit)
25 25
26 def test_non_auh_upgrade(self): 26 def test_non_auh_upgrade(self):