def test_errors_reset():
from jenkins_epo.bot import Error, Instruction
from jenkins_epo.utils import parse_datetime
from jenkins_epo.extensions.core import ErrorExtension
ext = ErrorExtension('error', Mock())
ext.current = ext.bot.current
ext.current.denied_instructions = []
ext.current.errors = [
Error('message', parse_datetime('2016-08-03T15:58:47Z')),
]
ext.current.error_reset = None
ext.process_instruction(
Instruction(name='reset-errors', author='bot', date=datetime.utcnow())
)
assert ext.current.error_reset
yield from ext.run()
assert not ext.current.head.comment.mock_calls
评论列表
文章目录