Update transclude tests

This commit is contained in:
Ben Felder 2020-02-28 15:12:51 +01:00
parent 10f08c5522
commit 6ae7cc5c54
No known key found for this signature in database
GPG Key ID: 47E17F94645FA481
8 changed files with 9 additions and 7 deletions

View File

@ -0,0 +1,3 @@
!include "../include_me.yml"
key_one: "i_am_from_copier.yml"

View File

@ -0,0 +1 @@
key_one: "i_am_from_include_me"

View File

@ -57,6 +57,10 @@ def test_invalid_yaml(capsys):
(
("tests/demo_invalid", {"_warning": False}, lambda x: "INVALID" in x),
("tests/demo_invalid", {"quiet": True}, lambda x: x == ""),
# test key collision between including and included file
("tests/demo_transclude_invalid/demo", {}, None),
# test key collision between two included files
("tests/demo_transclude_invalid_multi/demo", {}, None),
),
)
def test_invalid_config_data(conf_path, flags, check_out, capsys):
@ -221,11 +225,5 @@ def test_make_config_precedence(dst, test_input, expected):
def test_config_data_transclusion():
config = load_config_data("tests/demo_config_transclude/demo")
config = load_config_data("tests/demo_transclude/demo")
assert config["_exclude"] == ["exclude1", "exclude2"]
def test_config_data_multi_transclusion():
"""Test for key collision between two transcluded files."""
with pytest.raises(InvalidConfigFileError):
load_config_data("tests/demo_config_transclude_multi/demo")