def test_process_allow():
from jenkins_epo.bot import Instruction
from jenkins_epo.extensions.core import SecurityExtension
ext = SecurityExtension('sec', Mock())
ext.current = ext.bot.current
ext.current.head.author = 'contributor'
ext.current.security_feedback_processed = None
ext.current.SETTINGS.COLLABORATORS = ['owner']
ext.current.denied_instructions = [
Instruction(author='contributor', name='skip')
]
ext.process_instruction(Instruction(
author='owner', name='allow'
))
assert 'contributor' in ext.current.SETTINGS.COLLABORATORS
assert not ext.current.denied_instructions
评论列表
文章目录