def test_deny_non_collaborator_processed():
from jenkins_epo.bot import Instruction
from jenkins_epo.extensions.core import MergerExtension
ext = MergerExtension('merger', Mock())
ext.current = Mock()
ext.current.SETTINGS.COLLABORATORS = []
ext.current.last_commit.date = datetime.now()
ext.current.opm = None
ext.current.opm_denied = [Instruction(
author='noncollaborator', name='opm',
)]
ext.process_instruction(Instruction(
author='bot', name='opm-processed',
date=ext.current.last_commit.date + timedelta(hours=2),
))
assert not ext.current.opm
assert not ext.current.opm_denied
评论列表
文章目录