Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def change_with_files(files):
change = zuul.model.Change('mediawiki/ruby/api')
change.branch = 'master'
change.files.extend(files)
return change
def test_l10nbot_patchets_are_ignored(self):
test_manager = self.getPipeline('test').manager
change = zuul.model.Change('mediawiki/core')
change.branch = 'master'
l10n_event = zuul.model.TriggerEvent()
l10n_event.type = 'patchset-created'
l10n_event.account = {'email': 'l10n-bot@translatewiki.net'}
l10n_event.branch = change.branch
self.assertFalse(test_manager.eventMatches(l10n_event, change),
'l10-bot should not enter %s pipeline' %
test_manager.pipeline.name)
def test_recheck_with_verified_vote_minus_one(self):
test_manager = self.getPipeline('test').manager
change = zuul.model.Change('mediawiki/core')
change.branch = 'master'
event = zuul.model.TriggerEvent()
event.type = 'comment-added'
event.comment = 'Patch Set 1: Verified-1\n\nrecheck'
event.account = {'email': 'jdoe@wikimedia.org'}
event.branch = change.branch
self.assertFalse(test_manager.eventMatches(event, change))