def test_accept_lgtm():
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 = commit_date = datetime.now()
ext.current.opm = None
ext.current.opm_denied = []
ext.process_instruction(Instruction(
author='collaborator', name='opm',
date=commit_date + timedelta(hours=1),
))
assert 'collaborator' == ext.current.opm.author
assert not ext.current.opm_denied
评论列表
文章目录