def test_error_denied():
from jenkins_epo.bot import Instruction
from jenkins_epo.extensions.core import ErrorExtension
ext = ErrorExtension('error', Mock())
ext.current = ext.bot.current
ext.current.denied_instructions = [Mock()]
ext.current.errors = []
ext.current.error_reset = None
ext.process_instruction(
Instruction(name='reset-denied', author='bot')
)
assert not ext.current.denied_instructions
yield from ext.run()
assert not ext.current.head.comment.mock_calls
ext.current.denied_instructions = [Mock(author='toto')]
yield from ext.run()
assert ext.current.head.comment.mock_calls
评论列表
文章目录