From dd6894c1c8c9de49ba0eca59a4068d016efea321 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Mon, 1 Jul 2024 20:15:35 +0200 Subject: [PATCH] add test for multiple paths (bad) --- yamale/tests/test_command_line.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/yamale/tests/test_command_line.py b/yamale/tests/test_command_line.py index da80c96..5f42920 100644 --- a/yamale/tests/test_command_line.py +++ b/yamale/tests/test_command_line.py @@ -57,6 +57,16 @@ def test_multiple_paths_good_yaml(): ], "schema.yaml", 1, "PyYAML") +def test_multiple_paths_bad_yaml(): + with pytest.raises(ValueError) as e: + command_line._router([ + "yamale/tests/command_line_fixtures/yamls/bad.yaml", + "yamale/tests/command_line_fixtures/yamls/required_keys_bad.yaml", + ], "schema.yaml", 1, "PyYAML") + assert "map.bad: '12.5' is not a str." in e.value.message + assert "map.key: Required field missing" in e.value.message + + @pytest.mark.parametrize("parser", parsers) def test_good_relative_yaml(parser): command_line._router(