mirror of
https://github.com/copier-org/copier.git
synced 2025-05-05 15:32:54 +00:00
Update transclude tests
This commit is contained in:
parent
10f08c5522
commit
6ae7cc5c54
3
tests/demo_transclude_invalid/demo/copier.yml
Normal file
3
tests/demo_transclude_invalid/demo/copier.yml
Normal file
@ -0,0 +1,3 @@
|
||||
!include "../include_me.yml"
|
||||
|
||||
key_one: "i_am_from_copier.yml"
|
1
tests/demo_transclude_invalid_multi/include_me.yml
Normal file
1
tests/demo_transclude_invalid_multi/include_me.yml
Normal file
@ -0,0 +1 @@
|
||||
key_one: "i_am_from_include_me"
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user