diff options
author | Simon Glass <sjg@chromium.org> | 2025-04-29 07:22:20 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2025-05-27 10:07:41 +0100 |
commit | 289f4242c5d1290b3b474ff971131136dd7cbb7f (patch) | |
tree | cca590b2dd5c28f136473347cf72ca4fa1336566 /tools/patman/func_test.py | |
parent | 3fd99e2177c17539f4101151cb061e8f7700d6a1 (diff) |
patman: Simplify test_find_new_responses()
This test uses the find_new_responses() function which combines
accessing patchwork and processing the results.
Since the test is aimed at testing processing, adjust it to call
process_reviews() instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/func_test.py')
-rw-r--r-- | tools/patman/func_test.py | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 9c5e7d7dd51..3f7573a41a8 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -998,37 +998,33 @@ diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c self.commits = [commit1, commit2] self.patches = [patch1, patch2] count = 2 - new_rtag_list = [None] * count - review_list = [None, None] # Check that the tags are picked up on the first patch - pwork = patchwork.Patchwork.for_testing(self._fake_patchwork2) - status.find_new_responses(new_rtag_list, review_list, 0, commit1, - patch1, pwork) - self.assertEqual(new_rtag_list[0], {'Reviewed-by': {self.joe}}) + new_rtags, _ = status.process_reviews(patch1.content, patch1.comments, + commit1.rtags) + self.assertEqual(new_rtags, {'Reviewed-by': {self.joe}}) # Now the second patch - status.find_new_responses(new_rtag_list, review_list, 1, commit2, - patch2, pwork) - self.assertEqual(new_rtag_list[1], { + new_rtags, _ = status.process_reviews(patch2.content, patch2.comments, + commit2.rtags) + self.assertEqual(new_rtags, { 'Reviewed-by': {self.mary, self.fred}, 'Tested-by': {self.leb}}) # Now add some tags to the commit, which means they should not appear as # 'new' tags when scanning comments - new_rtag_list = [None] * count commit1.rtags = {'Reviewed-by': {self.joe}} - status.find_new_responses(new_rtag_list, review_list, 0, commit1, - patch1, pwork) - self.assertEqual(new_rtag_list[0], {}) + new_rtags, _ = status.process_reviews(patch1.content, patch1.comments, + commit1.rtags) + self.assertEqual(new_rtags, {}) # For the second commit, add Ed and Fred, so only Mary should be left commit2.rtags = { 'Tested-by': {self.leb}, 'Reviewed-by': {self.fred}} - status.find_new_responses(new_rtag_list, review_list, 1, commit2, - patch2, pwork) - self.assertEqual(new_rtag_list[1], {'Reviewed-by': {self.mary}}) + new_rtags, _ = status.process_reviews(patch2.content, patch2.comments, + commit2.rtags) + self.assertEqual(new_rtags, {'Reviewed-by': {self.mary}}) # Check that the output patches expectations: # 1 Subject 1 |