Implement config file validation

This commit is contained in:
Karolina Surma
2021-09-02 13:12:34 +02:00
parent 57ac75a838
commit 293ae7427f
3 changed files with 109 additions and 58 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ from pathlib import Path
import pytest
import conf2spec
import config
def get_config_files():
"""Yield the relative paths to the config files placed in 'tests/test_configs'."""
@@ -12,10 +12,10 @@ def get_config_files():
yield path
@pytest.mark.parametrize(("config"), get_config_files())
def test_generated_specfile(file_regression, config):
@pytest.mark.parametrize(("config_file"), get_config_files())
def test_generated_specfile(file_regression, config_file):
# Run the conf2spec converter
conf = conf2spec.load_configuration(config)
conf = config.ConfigFile(config_file)
rendered_file = conf2spec.write_spec_file(conf)
# Compare the results