def test_second_stage():
from jenkins_epo.extensions.jenkins import StagesExtension
ext = StagesExtension('stages', Mock())
ext.current = Mock()
ext.current.head.ref = 'pr'
ext.current.SETTINGS.STAGES = ['build', 'test']
ext.current.job_specs = specs = {
'test': Mock(config=dict()),
'missing': Mock(config=dict()),
}
specs['test'].name = 'test'
specs['missing'].name = 'missing'
ext.current.jobs = jobs = {
'test': Mock(),
}
jobs['test'].list_contexts.return_value = ['test']
ext.current.statuses = {}
yield from ext.run()
assert ext.current.current_stage.name == 'test'
评论列表
文章目录