summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest/tests/base.py
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2024-09-24 07:54:59 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-30 17:00:50 +0100
commitd6ede9c73b44062d8831a08f522d519591bf29c2 (patch)
tree17711c77f409da9d7ed38361c9551e6bb6f967dd /meta/lib/patchtest/tests/base.py
parentbb0f1625d7655d04c6df3c144e488f676ff2f762 (diff)
downloadpoky-d6ede9c73b44062d8831a08f522d519591bf29c2.tar.gz
patchtest: mbox.py: new data implementation
Consolidate and improve some objects: - absorb utils.py functionality - repo.py: use mbox.py - repo.py: remove some cruft - utils.py: replace with logs.py - utils.py: delete - patch.py: delete - scripts/patchtest: use logging directly - general cleanup (From OE-Core rev: d4fbdb1d15f281b236137d63710c73bca8911a36) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests/base.py')
-rw-r--r--meta/lib/patchtest/tests/base.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/meta/lib/patchtest/tests/base.py b/meta/lib/patchtest/tests/base.py
index 424e61b5be..911addb199 100644
--- a/meta/lib/patchtest/tests/base.py
+++ b/meta/lib/patchtest/tests/base.py
@@ -37,7 +37,6 @@ class Base(unittest.TestCase):
37 endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n') 37 endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n')
38 patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+') 38 patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+')
39 39
40
41 @staticmethod 40 @staticmethod
42 def msg_to_commit(msg): 41 def msg_to_commit(msg):
43 payload = msg.get_payload() 42 payload = msg.get_payload()
@@ -66,13 +65,13 @@ class Base(unittest.TestCase):
66 def setUpClass(cls): 65 def setUpClass(cls):
67 66
68 # General objects: mailbox.mbox and patchset 67 # General objects: mailbox.mbox and patchset
69 cls.mbox = mailbox.mbox(PatchTestInput.repo.patch) 68 cls.mbox = mailbox.mbox(PatchTestInput.repo.patch.path)
70 69
71 # Patch may be malformed, so try parsing it 70 # Patch may be malformed, so try parsing it
72 cls.unidiff_parse_error = '' 71 cls.unidiff_parse_error = ''
73 cls.patchset = None 72 cls.patchset = None
74 try: 73 try:
75 cls.patchset = unidiff.PatchSet.from_filename(PatchTestInput.repo.patch, encoding=u'UTF-8') 74 cls.patchset = unidiff.PatchSet.from_filename(PatchTestInput.repo.patch.path, encoding=u'UTF-8')
76 except unidiff.UnidiffParseError as upe: 75 except unidiff.UnidiffParseError as upe:
77 cls.patchset = [] 76 cls.patchset = []
78 cls.unidiff_parse_error = str(upe) 77 cls.unidiff_parse_error = str(upe)