mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +00:00
Add a hook for yaml files.
This commit is contained in:
parent
212b3dc49d
commit
3e45f53e68
8 changed files with 59 additions and 3 deletions
14
tests/check_yaml_test.py
Normal file
14
tests/check_yaml_test.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from pre_commit_hooks.check_yaml import check_yaml
|
||||
from testing.util import get_resource_path
|
||||
|
||||
|
||||
@pytest.mark.parametrize(('filename', 'expected_retval'), (
|
||||
('bad_yaml.notyaml', 1),
|
||||
('ok_yaml.yaml', 0),
|
||||
))
|
||||
def test_check_yaml(filename, expected_retval):
|
||||
ret = check_yaml([get_resource_path(filename)])
|
||||
assert ret == expected_retval
|
||||
Loading…
Add table
Add a link
Reference in a new issue