Add a hook for yaml files.

This commit is contained in:
Anthony Sottile 2014-04-03 21:36:03 -07:00
parent 212b3dc49d
commit 3e45f53e68
8 changed files with 59 additions and 3 deletions

14
tests/check_yaml_test.py Normal file
View 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