def test_yml_invalid(mocker, SETTINGS):
GITHUB = mocker.patch('jenkins_epo.extensions.core.GITHUB')
from jenkins_epo.extensions.core import YamlExtension
ext = YamlExtension('ext', Mock())
ext.current = ext.bot.current
ext.current.yaml = {}
ext.current.errors = []
GITHUB.fetch_file_contents = CoroutineMock(return_value="{INVALID")
head = ext.current.head
head.repository.url = 'https://github.com/owner/repo.git'
head.repository.jobs = []
yield from ext.run()
assert GITHUB.fetch_file_contents.mock_calls
assert ext.current.errors
评论列表
文章目录