Skip to content

Commit

Permalink
add test for multiple paths (bad)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagowfx authored and cblakkan committed Dec 28, 2024
1 parent ef9fe05 commit 6e25e32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yamale (ya·ma·lē)
| :warning: Ensure that your schema definitions come from internal or trusted sources. Yamale does not protect against intentionally malicious schemas. |
|:------------|

<img src="https://github.com/23andMe/Yamale/blob/main/yamale.png?raw=true" alt="Yamale" width="400"/>
<img src="https://github.com/23andMe/Yamale/blob/master/yamale.png?raw=true" alt="Yamale" width="400"/>

A schema and validator for YAML.

Expand Down Expand Up @@ -35,7 +35,7 @@ building Python 3 from source; in all three cases, Apple's Command Line Tools (C
may be required. See also [developers](#developers), below.

### Manual
1. Download Yamale from: https://github.com/23andMe/Yamale/archive/main.zip
1. Download Yamale from: https://github.com/23andMe/Yamale/archive/master.zip
2. Unzip somewhere temporary
3. Run `python setup.py install` (may have to prepend `sudo`)

Expand Down
10 changes: 10 additions & 0 deletions yamale/tests/test_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6e25e32

Please sign in to comment.