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