Commit 8cb24fb0 authored by Willi Rath's avatar Willi Rath

Add in-place rendering and param. tests

parent 0b0acd0a
# -*- coding:utf-8 -*-
import itertools
import data_repo_renderer
from pathlib import Path
import pytest
......@@ -236,8 +237,10 @@ def util(tmp_path):
return util_path
@pytest.mark.parametrize("cli_args_verbose", [[], ["--verbose"]])
@pytest.mark.parametrize("util_after", [True, False])
def test_full_yaml_example_01(util, yaml_example, tmp_path, util_after):
def test_full_yaml_example_01(util, yaml_example, tmp_path, util_after,
cli_args_verbose):
# Set up command line args
cli_args = ["--prefix", str(tmp_path / "rendered"),
......@@ -248,6 +251,9 @@ def test_full_yaml_example_01(util, yaml_example, tmp_path, util_after):
if util_after:
cli_args.insert(2, cli_args.pop(-1))
# cycle over verbose flag
cli_args = cli_args_verbose + cli_args
# and run the renderer
data_repo_renderer.cli_run_renderer(cli_args)
......@@ -260,3 +266,15 @@ def test_full_yaml_example_01(util, yaml_example, tmp_path, util_after):
assert all(
(tmp_path / "rendered" / "util" / file_name).exists()
for file_name in ["postprocessing_01.sh", "postprocessing_02.sh"])
@pytest.mark.parametrize("cli_args_verbose", [[], ["--verbose"]])
@pytest.mark.parametrize(
"cli_args_i_p_u",
[["--in-place", "--prefix", "some_prefix"],
["--in-place", "--util", "some_util"],
["--in-place", "--prefix", "some_prefix", "--util", "some_util"]])
def test_incompatible_cli_args(cli_args_i_p_u, cli_args_verbose):
cli_args = cli_args_verbose + cli_args_i_p_u + ["meta.yaml"]
with pytest.raises(ValueError):
data_repo_renderer.cli_run_renderer(cli_args)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment