def test_build_checks_yaml_syntax_error(self): # pylint: disable=C0103
path = os.path.abspath(os.path.dirname(__file__))
buildfilepath = os.path.join(path, 'build_checks_bad_syntax.yml')
checksorigpath = os.path.join(path, 'checks_bad_syntax.yml')
checksfilepath = os.path.join(path, 'checks.yml')
try:
origdir = os.curdir
os.chdir(path)
assert not os.path.exists(checksfilepath)
shutil.copy(checksorigpath, checksfilepath)
with assertRaisesRegex(self, command.CommandException, r'Bad yaml syntax.*checks\.yml'):
command.build('user/test', buildfilepath)
finally:
os.remove(checksfilepath)
os.chdir(origdir)
评论列表
文章目录