Ensure pipeline yaml files are valid YAML and can be rendered with JSON-e

Part of #613
This commit is contained in:
Marco Castelluccio 2019-06-26 18:35:13 +02:00
Родитель 6788b2e33a
Коммит bcf405c747
1 изменённых файлов: 25 добавлений и 0 удалений

25
tests/test_pipelines.py Normal file
Просмотреть файл

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import jsone
import pytest
import yaml
@pytest.mark.parametrize(
"pipeline_file",
(
os.path.realpath(os.path.join("infra", f))
for f in os.listdir("infra")
if f.endswith(".yml")
),
)
def test_jsone_validates(pipeline_file):
with open(pipeline_file, "r") as f:
yaml_content = yaml.safe_load(f.read())
jsone.render(yaml_content, context={"version": "42.0"})