mirror of
https://github.com/copier-org/copier.git
synced 2025-05-05 15:32:54 +00:00
Added test_multiple_config_file_error.
This commit is contained in:
parent
5c2177057f
commit
ef8f4042bc
0
tests/demo_multi_config/copier.yaml
Normal file
0
tests/demo_multi_config/copier.yaml
Normal file
0
tests/demo_multi_config/copier.yml
Normal file
0
tests/demo_multi_config/copier.yml
Normal file
@ -15,6 +15,7 @@ from copier.config.objects import (
|
|||||||
)
|
)
|
||||||
from copier.config.user_data import (
|
from copier.config.user_data import (
|
||||||
InvalidConfigFileError,
|
InvalidConfigFileError,
|
||||||
|
MultipleConfigFilesError,
|
||||||
load_config_data,
|
load_config_data,
|
||||||
load_yaml_data,
|
load_yaml_data,
|
||||||
)
|
)
|
||||||
@ -78,6 +79,13 @@ def test_invalid_quiet(capsys):
|
|||||||
assert out == ""
|
assert out == ""
|
||||||
|
|
||||||
|
|
||||||
|
def test_multiple_config_file_error(capsys):
|
||||||
|
with pytest.raises(MultipleConfigFilesError):
|
||||||
|
load_config_data("tests/demo_multi_config", quiet=True)
|
||||||
|
out, _ = capsys.readouterr()
|
||||||
|
assert out == ""
|
||||||
|
|
||||||
|
|
||||||
# Flags
|
# Flags
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"data",
|
"data",
|
||||||
@ -214,3 +222,6 @@ def test_make_config_good_data(dst):
|
|||||||
def test_make_config_precedence(dst, test_input, expected):
|
def test_make_config_precedence(dst, test_input, expected):
|
||||||
conf, flags = make_config(dst_path=dst, **test_input)
|
conf, flags = make_config(dst_path=dst, **test_input)
|
||||||
assert is_subdict(expected, conf.dict())
|
assert is_subdict(expected, conf.dict())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user