check_source: Allow a .changes line to mention 2 patches
This commit is contained in:
parent
939beac7fe
commit
55c4081ec0
@ -642,10 +642,9 @@ class CheckSource(ReviewBot.ReviewBot):
|
|||||||
continue
|
continue
|
||||||
# In any of those cases, remove the patch from the list
|
# In any of those cases, remove the patch from the list
|
||||||
line = line[1:].strip()
|
line = line[1:].strip()
|
||||||
for patch in patches_to_mention:
|
for patch in list(patches_to_mention):
|
||||||
if line.find(patch) >= 0:
|
if line.find(patch) >= 0:
|
||||||
del patches_to_mention[patch]
|
del patches_to_mention[patch]
|
||||||
break
|
|
||||||
|
|
||||||
# if a patch is mentioned as source, we ignore it
|
# if a patch is mentioned as source, we ignore it
|
||||||
sources = self._mentioned_sources(directory, specs)
|
sources = self._mentioned_sources(directory, specs)
|
||||||
|
@ -397,6 +397,21 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
|
|
||||||
self.assertReview(req_id, by_user=(self.bot_user, 'accepted'))
|
self.assertReview(req_id, by_user=(self.bot_user, 'accepted'))
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("default_config")
|
||||||
|
def test_two_patches_in_one_line(self):
|
||||||
|
"""Accepts patches even if mentioned in one line"""
|
||||||
|
self._setup_devel_project(devel_files='blowfish-with-two-patches')
|
||||||
|
|
||||||
|
req_id = self.wf.create_submit_request(self.devel_package.project,
|
||||||
|
self.devel_package.name, add_commit=False).reqid
|
||||||
|
|
||||||
|
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
|
self.review_bot.set_request_ids([req_id])
|
||||||
|
self.review_bot.check_requests()
|
||||||
|
|
||||||
|
self.assertReview(req_id, by_user=(self.bot_user, 'accepted'))
|
||||||
|
|
||||||
def _setup_devel_project(self, maintainer={}, devel_files='blowfish-with-patch-changes',
|
def _setup_devel_project(self, maintainer={}, devel_files='blowfish-with-patch-changes',
|
||||||
target_files='blowfish'):
|
target_files='blowfish'):
|
||||||
devel_project = self.wf.create_project(SRC_PROJECT, maintainer=maintainer)
|
devel_project = self.wf.create_project(SRC_PROJECT, maintainer=maintainer)
|
||||||
|
BIN
tests/fixtures/packages/blowfish-with-two-patches/blowfish-1.tar.gz
vendored
Normal file
BIN
tests/fixtures/packages/blowfish-with-two-patches/blowfish-1.tar.gz
vendored
Normal file
Binary file not shown.
10
tests/fixtures/packages/blowfish-with-two-patches/blowfish.changes
vendored
Normal file
10
tests/fixtures/packages/blowfish-with-two-patches/blowfish.changes
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 25 10:16:23 UTC 2022 - Stephan Kulow <coolo@suse.com>
|
||||||
|
|
||||||
|
- Add patch1.patch and patch2.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 8 07:36:30 UTC 2021 - Fisherman <fisherman@opensuse.org>
|
||||||
|
|
||||||
|
- Initial version.
|
||||||
|
- 1
|
21
tests/fixtures/packages/blowfish-with-two-patches/blowfish.spec
vendored
Normal file
21
tests/fixtures/packages/blowfish-with-two-patches/blowfish.spec
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2020 SUSE LLC
|
||||||
|
#
|
||||||
|
# This file is under MIT license
|
||||||
|
|
||||||
|
|
||||||
|
Name: blowfish
|
||||||
|
Version: 1
|
||||||
|
Release: 0
|
||||||
|
Summary: Blowfish
|
||||||
|
License: GPL-2.0-only
|
||||||
|
URL: https://github.com/openSUSE/cockpit-wicked
|
||||||
|
Source: blowfish-1.tar.gz
|
||||||
|
Patch1: patch1.patch
|
||||||
|
Patch2: patch2.patch
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autopatch
|
||||||
|
|
||||||
|
%changelog
|
5
tests/fixtures/packages/blowfish-with-two-patches/patch1.patch
vendored
Normal file
5
tests/fixtures/packages/blowfish-with-two-patches/patch1.patch
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
--- test.orig 2022-03-25 11:15:38.793593897 +0100
|
||||||
|
+++ test 2022-03-25 11:15:42.585630853 +0100
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-test
|
||||||
|
+test1
|
5
tests/fixtures/packages/blowfish-with-two-patches/patch2.patch
vendored
Normal file
5
tests/fixtures/packages/blowfish-with-two-patches/patch2.patch
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
--- test.orig 2022-03-25 11:15:42.585630853 +0100
|
||||||
|
+++ test 2022-03-25 11:16:07.273871454 +0100
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-test1
|
||||||
|
+test2
|
Loading…
x
Reference in New Issue
Block a user