Add test for group in bugowner line

This commit is contained in:
Stephan Kulow 2022-08-29 11:10:21 +02:00
parent a5ef99ba43
commit 009c133907
2 changed files with 15 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class CheckerBugowner(ReviewBot.ReviewBot):
if matched_package and matched_package != target_package:
continue
if not self.valid_maintainer(matched_maintainer):
self.review_messages['declined'] = f"\n{matched_maintainer} could not be found on this instance."
self.review_messages['declined'] += f"\n{matched_maintainer} could not be found on this instance."
return False
return True
self.review_messages['declined'] += f"\n{target_package } appears to be a new package and " + \

View File

@ -80,3 +80,17 @@ class TestCheckBugowner(OBSLocal.TestCase):
self.review_bot.check_requests()
self.assertReview(req_id, by_user=(self.bot_user, 'accepted'))
@pytest.mark.usefixtures("default_config")
def test_valid_bugowner_group(self):
"""Accept request with valid group maintainer"""
self.wf.create_group('coldpool')
req_id = self.wf.create_submit_request(
'devel:wine', 'merlot', description="This is a cool new package\nbugowner: group:coldpool").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'))